Mysql wont get field - 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 wont get field (
/showthread.php?tid=363647)
Mysql wont get field -
TheDeath - 28.07.2012
pawn Код:
new Query[256],pName[MAX_PLAYER_NAME],MyIP[16];
GetPlayerIp(playerid,IP[playerid],16);
GetPlayerName(playerid,pName,24);
format(Query,sizeof(Query),"SELECT * FROM `users` WHERE username = '%s' LIMIT 1",pName);
mysql_query(Query);
mysql_store_result();
mysql_affected_rows();
mysql_get_field("IP",MyIP);
printf("%s = %s", MyIP , IP[playerid]);
PRINT RETURNS "= 192.168.1.2" (the first ip is gone

)
Re: Mysql wont get field -
Misiur - 28.07.2012
Get mysql_errno() and display it's value
Re: Mysql wont get field -
TheDeath - 28.07.2012
When i add mysql_errno(); afther the print i dont get anyting in the console
Re: Mysql wont get field -
TheDeath - 28.07.2012
if(mysql_errno() == 0) print("Query processed!");
returning Query processed!
Im using varchar with lenght 16 and when i print(MyIP); it returns (null)