SA-MP Forums Archive
MySQL column problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL column problem (/showthread.php?tid=544838)



MySQL column problem - Grumbles - 04.11.2014

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();



Re: MySQL column problem - Grumbles - 04.11.2014

bump


Re: MySQL column problem - Vince - 04.11.2014

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.


Re: MySQL column problem - Grumbles - 06.11.2014

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


Re: MySQL column problem - Grumbles - 07.11.2014

bump


Re: MySQL column problem - Grumbles - 09.11.2014

bump


Re: MySQL column problem - Grumbles - 10.11.2014

I need help.


Re: MySQL column problem - Grumbles - 11.11.2014

bump


Re: MySQL column problem - Grumbles - 12.11.2014

bump


Re: MySQL column problem - Grumbles - 15.11.2014

bump