mariano / node-db-mysql

MySQL database bindings for Node.js
http://nodejsdb.org
150 stars 30 forks source link

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

Closed jkeys089 closed 11 years ago

jkeys089 commented 11 years ago

While attempting to execute a stored procedure I'm occasionally getting the "Commands out of sync; you can't run this command now" error.

It is my understanding that the problem is caused by me not cleaning up the additional result set being returned by the stored proc before attempting to call the procedure again.

I've seen solutions online (http://forums.mysql.com/read.php?52,140863,179132#msg-179132):

while (mysqli_more_results($dbc)) { 
    if (mysqli_next_result($dbc)) { 
        $result = mysqli_use_result($dbc); 
        mysql_free_result($result); 
    }
}

But I'm unsure how to work around this issue in db-mysql.

Any advice would be greatly appreciated.

mariano commented 11 years ago

Closed in b86bc68