SA-MP Forums Archive
Why does this fail - 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: Why does this fail (/showthread.php?tid=301687)



Why does this fail - iTorran - 05.12.2011

Dead Connection??

Код:
[13:20:33] ---------------------------
[13:20:33] 
[13:20:33] >> mysql_connect( )
[13:20:33] CMySQLHandler::CMySQLHandler() - constructor called.
[13:20:33] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "samp" | Username: "root" ...
[13:20:33] CMySQLHandler::Connect() - Connection was successful.
[13:20:33] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
[13:20:54] >> mysql_real_escape_string( Connection handle: 1 )
[13:20:54] CMySQLHandler::EscapeString(Torran); - Escaped 6 characters to Torran.
[13:20:54] >> mysql_query( Connection handle: 1 )
[13:20:54] CMySQLHandler::Query(SELECT * FROM `users` WHERE `Username` = 'Torran') - Successfully executed.
[13:20:54] >> mysql_num_rows( Connection handle: 1 )
[13:20:54] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)
[13:21:01] >> mysql_real_escape_string( Connection handle: 1 )



Re: Why does this fail - Vince - 05.12.2011

You must call mysql_store_result before calling mysql_num_rows.


Re: Why does this fail - iTorran - 05.12.2011

Cant believe i forgot to do that! ty