MySQL column problem
#1

Hi there, i'm trying to create a new mysql code line but there are some problems about character data upload, i can't create a new collum. For now I'm using 25 collums but the code i created wont read 26th collum. One with the case lines are okay but i'cant add a new one. I'm currently using wampserver, i can open the mode there but when i want to enter the game it won't read it <<>> spawn screen won't see the data and it loops.

Код:
stock PlayerLoginLoad(playerid)
{
	new query[128];
	format(query, sizeof(query), "SELECT * FROM `users` WHERE `id` = '%d'", Users[playerid][sqlid]);
	mysql_query(query);
	mysql_store_result();
	mysql_fetch_row_format(query, "|");
	new arrCoords[128];
	new d, li;
	new aNum;
	new len;
	while(d <= strlen(query))
	{
	    if(query[d]=='|' || d==strlen(query))
		{
	        len = strmid(arrCoords, query, li, d, 128);
	        arrCoords[len] = 0;
			switch(aNum)
			{
			    case 0: Users[playerid][sqlid] = strval(arrCoords);
			    case 3: Users[playerid][posx] = strval(arrCoords);
			    case 4: Users[playerid][posy] = strval(arrCoords);
			    case 5: Users[playerid][posz] = strval(arrCoords);
			    case 6: Users[playerid][interior] = strval(arrCoords);
			    case 7: Users[playerid][vworld] = strval(arrCoords);
			    case 8: Users[playerid][level] = strval(arrCoords);
			    case 9: Users[playerid][cash] = strval(arrCoords);
			    case 10: Users[playerid][skin] = strval(arrCoords);
			    case 11: Users[playerid][hp] = strval(arrCoords);
			    case 12: Users[playerid][licenseidno] = strval(arrCoords);
			    case 13: Users[playerid][adminlevel] = strval(arrCoords);
			    case 14: Users[playerid][ban] = strval(arrCoords);
				case 15: strmid(Users[playerid][reason], arrCoords[15], 0, strlen(arrCoords[15]), 255);
				case 16: Users[playerid][chattype] = strval(arrCoords);
				case 17: Users[playerid][payday] = strval(arrCoords);
				case 18: Users[playerid][time] = strval(arrCoords);
				case 19: Users[playerid][paydaybonus] = strval(arrCoords);
				case 20: Users[playerid][exp] = strval(arrCoords);
				case 21: Users[playerid][bank] = strval(arrCoords);
				case 22: Users[playerid][bankno] = strval(arrCoords);
				case 23: Users[playerid][phonenumber] = strval(arrCoords);
			}
   			li = d+1;
      		aNum++;
      		printf("%d", strval(arrCoords));
		}
		d++;
	}
	mysql_free_result();
Reply
#2

bump
Reply
#3

Use sscanf for string splitting. That's definitely a lot easier. However, you might as well update the plugin immediately. It has functions to fetch values directly into variables without the need for any conversion in Pawn.
Reply
#4

That did not work out i still don't know how to fix it.
Reply
#5

bump
Reply
#6

bump
Reply
#7

I need help.
Reply
#8

bump
Reply
#9

bump
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)