Php (as the mainstream development language) is required to call the stored procedure, return a result set, and find it difficult. after searching for a long time, I finally found a solution on a foreign forum, here we will localize it. The key is two points: 1) define (CLIENT_MULTI_RESULTS, 131072); 2) & #36; linkMySQL (the most Syn used with PHP)
Php (as the mainstream development language) is required to call the stored procedure, return a result set, and find it difficult. after searching for a long time, I finally found a solution on a foreign forum, here we will localize it.
Two key points
1) define (CLIENT_MULTI_RESULTS, 131072 );
2) $ link = MySQL (the best combination with PHP) _ connect ("127.0.0.1", "root", "", 1, CLIENT_MULTI_RESULTS) or die ("cocould not connect: ". mySQL (the best combination with PHP) _ error ());
The following is an example program.
Define (CLIENT_MULTI_RESULTS, 131072 );
$ Link = MySQL (best combination with PHP) _ connect ("127.0.0.1", "root", "", 1, CLIENT_MULTI_RESULTS) or die ("cocould not connect :". mySQL (the best combination with PHP) _ error ());
MySQL (best combination with PHP) _ select_db ("vs") or die ("cocould not select database ");
?>
$ Result = MySQL (the best combination with PHP) _ query ("call get_news_from_class_id (2)") or die ("Query failed :". mySQL (the best combination with PHP) _ error ());
While ($ row = MySQL (the best combination with PHP) _ fetch_array ($ result, MySQL (the best combination with PHP) _ ASSOC ))
{
$ Line =. $ Row ["title"]. (. $ row ["page_time"].).R>;
Echo $ line;
Printf ("");
}
MySQL (the best combination with PHP) _ free_result ($ result );
?>
MySQL (the best combination with PHP) _ close ($ link );
?>