Log in

View Full Version : Commands out of sync; you can't run this command now in mysql php



kumarramesh2020
07-29-2009, 12:09 PM
Hi to every one,

I am getting the error when am executing two stored procedures. the first stored procedure is sucessfully executing. when second stored procedure is executing am getting the error as " Commands out of sync; you can't run this command now ". I searched. in the internet. " I studied in http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html. but even am not getting the correct answer. "

My task is to insert a rocord in employee table where username should be unique. so first we have to check where the given username is unique or not in employee table for that i write one stored procedure for calculating the number of rows in employee table with that username . if the given username is unique means(number of rows is zero) again i have to write stored procedure to insert a reocrd in the database.
in this scenario first stored procedure is excecting sucessfully. while execting second stored procedure am getting the error as "Commands out of sync; you can't run this command now ".

can any one help me out how to free the memory resultant set with example