hi all,
I've been using standard php/mysql and I wanted to try my hand at stored procedures so i modified my old php script to use mysql stored procedures.
<?PHP
$open = mysql_connect($dbConfig['dbServer'], $dbConfig['dbUser'], $dbConfig['dbPassword'], true);
$set = mysql_select_db($dbConfig['dbDatabase'], $open)
.
.
.
// run the query.
if(!$result = mysql_query('call selectworkorders("'.$where.'","'.$order.'")')){
logMsg(__LINE__,'E','Could not execute query: '.mysql_error()); exit;
}
?>
The stored procedure is working fine but i get an error:
Could not execute query: Commands out of sync; you can't run this command now. I believe this is due to stored procedures returning multiple sets - a result set and a data set. After some research, it appears i need to convert my php script from MySQL to MySQLi in order to get this to work.
My questions are:
1. Is there a way to get this to work the way it is without converting to MySQLi?
2. Is MySQLi (the wave of the future) what i should be using in all future php scripts?
3. If so, does it matter whether i use procedural or oo php?
thanks.