Raised This Month: $ Target: $400
 0% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kiske
Veteran Member
Join Date: May 2009
Old 12-18-2011 , 23:58   SQL Error: Commands out of sync; you can't run this command now
Reply With Quote #1

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!

Last edited by Kiske; 12-18-2011 at 23:59.
Kiske is offline
Send a message via Skype™ to Kiske
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-19-2011 , 02:25   Re: SQL Error: Commands out of sync; you can't run this command now
Reply With Quote #2

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.
__________________
Impossible is Nothing
Sylwester 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 12:05.


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