PHP calls the stored procedure returns the result set, solves the can ' t return a results set in the given the method needing the PHP to call the stored procedure, returns a result set, discovers very difficult, looked for a long time, finally found the solution in the Foreigner's Forum, Localize here.
The key is two.
1) define (' Client_multi_results ', 131072);
2) $link = mysql_connect ("127.0.0.1", "Root", "" ", 1,client_multi_results) or die (" Could not connect: ". Mysql_error ());
The following is the normal use, the following is an example program.
<?php
Define (' Client_multi_results ', 131072);
$link = mysql_connect ("127.0.0.1", "Root", "", 1,client_multi_results) or die ("Could not connect:". Mysql_error ());
mysql_select_db ("vs") or Die ("could not select Database");
?>
<?php
$result = mysql_query ("Call get_news_from_class_id (2)") or Die ("Query failed:". Mysql_error ());
while ($row = Mysql_fetch_array ($result, MYSQL_ASSOC))
{
$line = ' <tr><td><a target = _blank href=\ '. $row [url]. ' \ ' > '. $row [title]. ' ('. $row [page_time]. ') '. ' </a></td></t
r> ';
echo $line;
printf ("\ n");
}
Mysql_free_result ($result);
?>
<?php
Mysql_close ($link);
?>