SA-MP Forums Archive
MySQL little 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 little problem (/showthread.php?tid=642620)



MySQL little problem - XHunterZ - 03.10.2017

so iam trieng to create another town but when i asked how someone gave me this code but it always returns the value as 0, even it is 1 in the database, so what is the problem? im using StrickenKid's MySQL Plugin - v2.1.1



Код:
 		new townQuery[200];
		new townspawn;
		format(townQuery, sizeof(townQuery), "SELECT `town` FROM `playerdata` WHERE `playerName` = '%s'", playerNamee);
		mysql_query(townQuery), mysql_store_result();
		if(mysql_num_rows() != 0)
		{
			mysql_fetch_row(townQuery);
			sscanf(townQuery, "i", townspawn);
			mysql_free_result();
		}
		switch(townspawn)
		{
			case -1:
			{
				ShowPlayerDialog(playerid, DIALOG_TOWN, DIALOG_STYLE_LIST, "Choose Spawn Town", "San Fierro \nLas Venturas", "Choose", "");
				TogglePlayerSpectating(playerid, true);
			}
			case 0:
			{
			    playerData[playerid][playerTown] = SF;
			}
			case 1:
			{
	 			playerData[playerid][playerTown] = LV;
			}
		}



Re: MySQL little problem - biker122 - 03.10.2017

Posting your SQL log would help a bit..


Re: MySQL little problem - whadez - 03.10.2017

Update your SQL to 41-4 you dont live in early 2010.


Re: MySQL little problem - XHunterZ - 03.10.2017

Quote:
Originally Posted by whadez
Посмотреть сообщение
Update your SQL to 41-4 you dont live in early 2010.
what is 41-4? and if i update the include, i have to change all MySQL functions in the GM? its a huge GM but im still learning and asking for help


Re: MySQL little problem - XHunterZ - 03.10.2017

Quote:
Originally Posted by biker122
Посмотреть сообщение
Posting your SQL log would help a bit..
no thing in the log


Код:
[Sun Oct  1 17:00:46 2017] -------------------------
[Sun Oct  1 17:00:46 2017]      Logging Started
[Sun Oct  1 17:00:46 2017] -------------------------
[Sun Oct  1 17:00:47 2017] Connected (0) to server_989 @ 127.0.0.1 via TCP/IP.
[Sun Oct  1 17:00:47 2017] MySQL Server Version 5.5.50-0+deb8u1.



Re: MySQL little problem - Unrea1 - 03.10.2017

If you want better compatibility use SA-MP 0.3a or 0.2x.

Update your plugin, god.