PHP Call stored procedure returns result set, resolves cant return a result set in_php tutorial

Source: Internet
Author: User

Need php call stored procedure, return a result set, find very difficult, find a half-day, finally in the Foreigner's Forum find solution, here localization.

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 can be used normally, the following is an example program.

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");
?>

$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 =. $row ["title"]. (. $row ["Page_time"].). r>;
Echo $line;
printf ("");

}
Mysql_free_result ($result);
?>

Mysql_close ($link);
?>

http://www.bkjia.com/PHPjc/508368.html www.bkjia.com true http://www.bkjia.com/PHPjc/508368.html techarticle need php Call stored procedure, return a result set, find very difficult, find a half-day, finally in the Foreigner's Forum find solution, here localization. The key is two point 1) ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.