Home > Backend Development > PHP Tutorial > PHP calls a stored procedure to return a result set, solve cant return a result set in_PHP tutorial

PHP calls a stored procedure to return a result set, solve cant return a result set in_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:35:17
Original
977 people have browsed it

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());


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

& lt;? PHP
$ 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);

?>

mysql_close($link);

?>

http://www.bkjia.com/PHPjc/508368.html

truehttp: //www.bkjia.com/PHPjc/508368.htmlTechArticleNeed PHP to call the stored procedure and return a result set. I found it very difficult. After searching for a long time, I finally found it on the foreigner's forum. Found the solution on the website, localize it here. The key points are two points 1)...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template