B.5.2.14 コマンドは同期されていません


たとえば、これは、mysql_free_result() を呼び出す前に、mysql_use_result() を使用して、新しいクエリーを実行しようとした場合に発生することがあります。これは、データを返す 2 つのクエリーの間に mysql_use_result() または mysql_store_result() を呼び出さずに実行した場合にも発生することがあります。

Download this Manual
EPUB - 7.5Mb
HTML Download (TGZ) - 7.1Mb
HTML Download (Zip) - 7.2Mb
User Comments
  Posted by Justin Finkelstein on February 17, 2005
I have just identified and resolved a recurring problem with this error when using PHP in FreeBSD 5.3.

If you're using mysql_pconnect and you call that function repeatedly, and then execute queries on that connection, you will receive this error message. This may be due to the way persistent connections are handled in FreeBSD.

The workaround is to use mysql_connect, which does not generate this error message.
  Posted by Jon Stephens on February 23, 2005
It's best to avoid using mysql_pconnect() in any case, as persistent connections are not supported in PHP 5's mysqli extension (to which all PHP/MySQL development will eventually need to be ported), and really aren't of benefit to Web applications.
  Posted by Peter Sierst Nielsen on March 26, 2005
This error just occured coding C using the "mysqlclient include" having multiple instances of the structure:

struct DB {
MYSQL mysql;
MYSQL_RES *result;
unsigned long numRows;
unsigned long numFields;

... and THEN forgetting to call init/connect/select_db on all but one.
Just wasted half an hour :| Hope it's going to be of use for the next person.
Regards, Peter Sierst Nielsen
  Posted by Vyacheslav Brover on September 1, 2009
The problem is avoided if prepared statements with cursors are used:

const unsigned long type = (unsigned long) CURSOR_TYPE_READ_ONLY;
mysql_stmt_attr_set (stmt, STMT_ATTR_CURSOR_TYPE, (void*) &type);

Sign Up Login You must be logged in to post a comment.