Hi fellows,
I have problem in php code and I had searched in days but I didn't found something good.
The problem is when execute the following code and error occured:
$sql = "CALL categoriesSelectByParent($CategId)";
if(!($result = $con->query($sql)))
echo "Failed: (" . $con->errno . ") " . $con->error;
else {
//Do something with the result.
}
$result->free();
$sql = "CALL booksSelectByCategoryId($CategId)";
if(!($result = $con->query($sql)))
echo "Failed: (" . $con->errno . ") " . $con->error;
else {
//Do something with the result.
}
the error is:
"Failed: (2014) Commands out of sync; you can't run this command now"
I know the error because of the second call. But how can I solve this.
I hope somebody have the solution.