AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to chack if a mysql select was successfull? (https://forums.alliedmods.net/showthread.php?t=3715)

splaTTer 07-12-2004 12:19

how to chack if a mysql select was successfull?
 
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

BAILOPAN 07-12-2004 13:21

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

splaTTer 07-12-2004 16:40

sorry my fault... i didn't reset found = 1 to found = 0 at the end of my function :( /stupid me


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

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