List:General Discussion« Previous MessageNext Message »
From:Jani Tolonen Date:October 8 2001 8:06am
Subject:Commands out of sync: You can't run this command now.
View as plain text  
=?EUC-KR?B?GyQpQw49SUNmOjgP
?= writes:
 > Hi all.
 > 
 > Let's assume the function Foo lke below.
 > 
 > void Foo()
 > {
 > 	dbGetMaxNo();
 > 	dbInsert();
 > }
 > 
 > dbGetMaxNo returns maximum number of a certain column and dbInsert inserts
 > just one row in table.
 > These tow functions access same table and use same DB connection.
 > 
 > dbGetMaxNo() is executed successfully.
 > But when execute dbInsert() there occurs an error that is "Commands out of
 > sync: You can't run this command now."
 > 
 > What's wrong with this?
 > 
 > Please tell me the answer.
 > 
 > Thanks in advance!
<cut>

Hi!

Two possibilities:

1.

You may be experiencing problems from possible mix of two different
MySQL installations. Please check what version (and the date) of
files 'mysql.h' and 'libmysqlclient.a' your client is using. They
must be from the same MySQL installation. If they are not, please
recompile your client using the correct files.

2.

Please check your client code, you may be calling client functions in
wrong order, for example:

when using mysql_use_result(), you must execute mysql_fetch_row()
until a NULL value is returned, otherwise the unfetched rows will be
returned as part of the result set for your next query, which will
result in the error.

Or it can happen, for example, if you are using mysql_use_result() and
try to execute a new query before you have called
mysql_free_result(). It can also happen if you try to execute two
queries that return data without a mysql_use_result() or
mysql_store_result() in between.

Please consult the documentation of the client functions that you are
using.

Regards,

- Jani

For technical support contracts, visit https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Jani Tolonen <jani@stripped>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
/_/  /_/\_, /___/\___\_\___/   Helsinki, Finland
       <___/   www.mysql.com
Thread
Commands out of sync: You can't run this command now.심충보7 Oct
  • Commands out of sync: You can't run this command now.Jani Tolonen8 Oct