Click here to Skip to main content
15,888,273 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
PHP
$result = mysql_query("CALL verCamasDisponiveis('".$_SESSION['pID']."')")
or die ("Erro-- ".mysql_error());

$camasd = mysql_fetch_array($result);
$n = $camasd['Count(Descricao)'];

mysql_free_result($result);

$result = mysql_query("CALL verMobiliario('".$_SESSION['pID']."')")
or die ("Erro1-- ".mysql_error());


Both returns only one field/row.

At the second I get
Commands out of sync; you can't run this command now


I have php5. At Mysql shell those procedures work fine. How can I solve this?
Posted
Updated 31-May-11 7:13am
v3

1 solution

Since we only have the two lines of code you posted, I'll give it a shot and refer you to this interesting bit I found: http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html[^].

I hope that explains your misery ;)!

Cheers!

-MRB
 
Share this answer
 
Comments
Maxdd 7 31-May-11 13:12pm    
Unfortunately not :(

Those two procs just have two SELECT statements:

SELECT Count(Descricao) FROM Inventario WHERE CelaID IS NULL AND Descricao = 'Cama' AND pID = prID;

I tried the mysql_free_result but don't work :( Check out my updated answer..

" It can also happen if you try to execute two queries that return data without calling mysql_use_result() or mysql_store_result() in between"

PHP5 does not have any of those ..
Maxdd 7 31-May-11 13:22pm    
All information I found it was referring to mysqli, but I don't use that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900