MYSQL ip returns blank - 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 ip returns blank (
/showthread.php?tid=351972)
MYSQL ip returns blank -
Saurik - 17.06.2012
Hello guys. I am working on an auto-login code and im having problems. I am trying to retrieve an IP of a user from the database but it return blank with the following mysql error
Код:
17:19:45] CMySQLHandler::Query(SELECT `IP` FROM `users` WHERE `Username` = 'Saurik') - Successfully executed.
[17:19:45] >> mysql_store_result( Connection handle: 1 )
[17:19:45] CMySQLHandler::StoreResult() - Result was stored.
[17:19:45] >> mysql_fetch_field_row( Connection handle: 1 )
[17:19:45] CMySQLHandler::FetchField(IP) - You cannot call this function now. (Reason: Fields/Rows are empty.)
[17:19:45] >> mysql_query( Connection handle: 1 )
Here is my code
http://pastebin.com/33bW7MUa
When i print the ip that is retrieved from the DB, its blank. >> The field IP does exist and has an ip in it <<
Re: MYSQL ip returns blank -
A7X_CEEJAY - 17.06.2012
Just going out on a limb here, as i'm shit with MYSQL Stuff and yeah but
pawn Код:
printf("oldip %s ",oldip);
Try
Re: MYSQL ip returns blank -
Calgon - 17.06.2012
You need to use
mysql_retrieve_row() to retrieve the row.