Home >Backend Development >PHP Tutorial >PHP calls a stored procedure to return a result set, solve cant return a result set in_PHP tutorial
You need PHP to call a stored procedure and return a result set. I found it very difficult. After searching for a long time, I finally found a solution on a foreigner’s forum. Let’s localize it here. The key is two points 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()); define(CLIENT_MULTI_RESULTS, 131072); $link = mysql_connect("127.0.0.1", "root", "",1,CLIENT_MULTI_RESULTS) or die("Could not connect: ".mysql_error()); & lt;? PHP ?> mysql_close($link); ?> http://www.bkjia.com/PHPjc/508368.html
The following can be used normally. The following is an example program.
mysql_select_db("vs") or die("Could not select database");
?>
$ result = mysql_query ("call get_news_from_id_id (2)") ORe ("query failed:" .mysql_error ()); _Fetch_array ($ result, MYSQL_ASSOC))
$line = .$row["title"].( .$row["page_time"].). r>;
echo $line;
printf("
");
} mysql_free_result($result);
Related articles
See more