AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SQL Error: Commands out of sync; you can't run this command now (https://forums.alliedmods.net/showthread.php?t=174331)

Kiske 12-18-2011 23:58

SQL Error: Commands out of sync; you can't run this command now
 
Hi.

Im saving the info of a user.
The problem is that in the command that i send they don't work and the info don't get saved.

The error appears in the title:
Code:

Commands out of sync; you can't run this command now

And the code is the next one:
PHP Code:

new Handle:sql_consult SQL_PrepareQuery(g_sql_connection"UPDATE users SET combo_max='%d' WHERE `id`='%d'"g_combo_leaderg_user[id]);
if(!
SQL_Execute(sql_consult))
{
    new 
sql_error[512];
    
SQL_QueryError(sql_consultsql_error511);

    
log_to_file("error_sql.log""%s"sql_error);
}
SQL_FreeHandle(sql_consult); 


Thanks in advance!

Sylwester 12-19-2011 02:25

Re: SQL Error: Commands out of sync; you can't run this command now
 
It seems that you forgot to use SQL_FreeHandle somewhere. The code you posted is not enough to find and fix the problem. I would use threaded queries to save user info.


All times are GMT -4. The time now is 12:05.

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