>> You seem to be mimicking the prepared query feature of mysqli in PHP5.
Do you
>> have the mysqli extension available? If so, you can use things like:
>>
>> http://www.php.net/manual/en/function.mysqli-stmt-bind-param.php
>>
>> which has an example as to how to utilize a prepared query.
>>
>>
> I never really looked into mysqli, so far I only used the mysql
> extension in PHP.
> So maybe that will help.
> thanks
Filipe,
As someone else suggested, the mysql extension also works just fine:
<?php
// StoredProc(@param1, param2) sums a table Id int column and divides by param2.
// The result is stuffed into @param1
$query1 = "call StoredProc(@param1, param2)";
$result1 = mysql_query($query1) or die('Query failed: ' . mysql_error());
$query2 = "select @param1";
$result2 = mysql_query($query2) or die('Query failed: ' . mysql_error());
echo "<table>\n";
while ($line = mysql_fetch_array($result2, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
?>
David