PHP Call stored procedure returns result set, resolves cant return a result set in the given conte_php tutorial

Source: Internet
Author: User
Need PHP (as the mainstream development language now) call the stored procedure, return a result set, found very difficult, find a half-day, finally found in the Foreigner's Forum solution, here localization.

The key is two.

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 (" Could Not Connect: "). MySQL (and PHP collocation of the best combination) _error ());


The following can be used normally, the following is an example program.

Define (Client_multi_results, 131072);

$link = MySQL (the best combination with PHP) _connect ("127.0.0.1", "Root", "" ", 1,client_multi_results) or Die (" Could Not Connect: "). MySQL (and PHP collocation of the best combination) _error ());
MySQL (and PHP collocation best combination) _select_db ("vs") or Die ("Could not select Database");
?>

$result = MySQL (best combination with PHP) _query ("Call get_news_from_class_id (2)") or Die ("Query failed:"). MySQL (and PHP collocation of the best combination) _error ());
while ($row = MySQL (best combination with PHP) _fetch_array ($result, MySQL (best combination with PHP) _ASSOC))
{
$line =. $row ["title"]. (. $row ["Page_time"].). r>;
Echo $line;
printf ("");

}
MySQL (the best combination of PHP collocation) _free_result ($result);
?>

MySQL (the best combination of PHP collocation) _close ($link);
?>

http://www.bkjia.com/PHPjc/508628.html www.bkjia.com true http://www.bkjia.com/PHPjc/508628.html techarticle need PHP (as the mainstream development language now) call the stored procedure, return a result set, find very difficult, find a half-day, finally found the solution on the Foreigner's Forum, here Local ...

  • 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.