11.11.2011, 15:02
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.
It prints -1 no matter what.
Does anyone see anything I've done wrong?
Thanks...
- Matt
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);
Does anyone see anything I've done wrong?
Thanks...
- Matt