Mysql handle returning 0 on query problem
getting a strange callback could any one see if i am doing it wrong
Code:
#include <amxmodx>the query error is 02/27/2006 - 13:13:44: [MYSQL] Invalid database handle 0 02/27/2006 - 13:13:44: [AMXX] Displaying debug trace (plugin "NickProtect.amxx") 02/27/2006 - 13:13:44: [AMXX] Run time error 10: native error (native "dbi_query") 02/27/2006 - 13:13:44: [AMXX] [0] NickProtect.sma::client_authorized (line 53) Dropped sucks from server Reason: Client sent 'drop' i am presumeing that its returning 0 on the rows wich just shouldnt be true as there is one name in it can any one see anything wrong here... |
That's not your whole plugin. Can you post the entire thing and enclose it in the [small ] tags?
Having said that, you need to check the result from a query to see if it failed. Your code presumes it will always succeed. Ex: Code:
|
Code:
the error comes back as Adding master server 68.142.72.250:27010 Adding master server 69.28.151.162:27010 L 02/27/2006 - 14:09:22: [MYSQL] Invalid database handle 0 L 02/27/2006 - 14:09:22: [AMXX] Displaying debug trace (plugin "NickProtect.amxx") L 02/27/2006 - 14:09:22: [AMXX] Run time error 10: native error (native "dbi_query") L 02/27/2006 - 14:09:22: [AMXX] [0] |
What line sparks that error?
|
Quote:
Code:
|
you can't put clientname at the end of dbi_query()
Use format() to fix this. Example: Code:
|
Quote:
still same error L 02/27/2006 - 14:51:37: [MYSQL] Invalid database handle 0 Code:
seems to be anoyed at the result code for some reason |
ok this is a little more info on the issue
i changed the code abit so i could see better what was going on
Code:
in the console i got back couldn't exec banned.cfg Adding master server 69.28.151.162:27010 Adding master server 207.173.177.11:27010 [Logger-ClientAuth-1] ClientSteamid is: STEAM_ID_LAN [Logger-ClientAuth-1] ClientName is: [DumB]SteamSucks [Logger-ClientAuth-1] Sending sql string SELECT * FROM `savednames` WHERE `steamid` = 'STEAM_ID_LAN' L 02/27/2006 - 16:33:15: [MYSQL] Invalid result handle 0 L 02/27/2006 - 16:33:15: [AMXX] Displaying debug trace (plugin "sqltest.amxx") L 02/27/2006 - 16:33:15: [AMXX] Run time error 10: native error (native "dbi_num_rows") L 02/27/2006 - 16:33:15: [AMXX] [0] sqltest.sma::client_authorized (line 70) as you can see the actual select string was correct and in mysql i used the same string and got back one result so why is amx mod telling me that the result handle is 0 ie no results when it truely is a hit here is mysql direct result below Showing rows 0 - 0 (1 total, Query took 0.0006 sec) SQL-query: SELECT * FROM `savednames` WHERE `steamid` = 'STEAM_ID_LAN' LIMIT 0 , 30 any more ideas people before this totally gives me a brain melt down. |
put
Code:
not Code:
|
Your problem lies within
Code:
You are not supposed to free the result untill after you parse everything out of it so make it Code:
|
| All times are GMT -4. The time now is 20:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.