Raised This Month: $ Target: $400
 0% 

how to chack if a mysql select was successfull?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
splaTTer
Junior Member
Join Date: Jul 2004
Old 07-12-2004 , 12:19   how to chack if a mysql select was successfull?
Reply With Quote #1

hi,
i tried:
Code:
found = 0
format(querysea,255,"SELECT * FROM amx_pricegamers WHERE player_steam='%s'", authid);
if(mysql_query(mysql,querysea)>0){
    found = 1
    }
client_print(id,print_chat,"found=%d",found)
but found is always 1

how to test if a mysql query has a result or not?

thx and greetz splaTTer
splaTTer is offline
BAILOPAN
Join Date: Jan 2004
Old 07-12-2004 , 13:21  
Reply With Quote #2

Right now, the only thing that can return from a failed query is QUERY_FAILED, or -5.

I don't know why it's always 1 for you if there's an error. Keep in mind this for the next AMX Mod X release:

http://forums.alliedmods.net/showthread.php?t=2632
__________________
egg
BAILOPAN is offline
splaTTer
Junior Member
Join Date: Jul 2004
Old 07-12-2004 , 16:40  
Reply With Quote #3

sorry my fault... i didn't reset found = 1 to found = 0 at the end of my function /stupid me
splaTTer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode