SA-MP Forums Archive
A little confused about Blue's MySQL Include - 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: A little confused about Blue's MySQL Include (/showthread.php?tid=296425)



A little confused about Blue's MySQL Include - Shoulen - 11.11.2011

Hi!

Okay, so to start off, please don't shout at me if I overlooked something, I've been following the documentation on the Wiki about the BlueG's MySQL plugin, I'm not new to scripting or working with MySQL, I am however, unfamiliar with the way the MySQL callbacks (specific to BlueG's include) work in PAWNO and I seem to be having a little bit of an issue with it, I am trying to run a query to check if the player's name is in the database, I have already established successful connection to the server and when it comes time for me to check if any results have resulted at which point I run "mysql_num_rows();" it would seem the result (regardless of whether the player's name is there or not) is set to -1.

Код:
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
   	new query[128];
    format(query, sizeof(query), "SELECT * FROM `SAMP` WHERE `playername` LIKE '%s' LIMIT 0 , 30", pname);
VALUES ('Matthew_MyName', '192.168.182.124', 'No Reason, just wondering, you knwo how it is ? hehe, I do....', 'Kalvin', '15:50 11/11/2011', '16:00 11/11/2011')";
	mysql_query(query);
	mysql_store_result();
	new rows = mysql_num_rows();
	printf("%i",rows);
It prints -1 no matter what.

Does anyone see anything I've done wrong?
Thanks...

- Matt


Re: A little confused about Blue's MySQL Include - Calgon - 11.11.2011

Enable mysql_debug() in OnGameModeInit, and see what's printed in the mysql_debug.txt file.

Also, the language is pawn, not "pawno", that's the IDE we use to script pawn.


Re: A little confused about Blue's MySQL Include - Shoulen - 11.11.2011

Thanks Calgon!