1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > php调用存储过程返回结果集

php调用存储过程返回结果集

时间:2022-10-10 07:17:15

相关推荐

php调用存储过程返回结果集

php教程|php手册

nbsp,mysql,result,RESULTS,connect

php教程-php手册

php调用存储过程返回结果集,解决can’t return a result set in the given context错误的方法需要php调用存储过程,返回一个结果集,发现很困难,找了半天,终于在老外的论坛上找到解决方案,这里本地化一下。

关键就是两点

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

下面就可以正常使用了,以下是例子程序。

<?php

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

?>

<?php

$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 = ‘

thinkphp 视频网站源码,ubuntu磁盘如何扩容,爬虫如何自动登录,php 开发特点,seo最终目的lzw

‘.$row[“title”].(‘.$row[“page_time”].’)’.’

</t

r>’;

echo $line;

printf(“\n”);

}

mysql_free_result($result);

?>

<?php

mysql_close($link);

?>

卡盟销售网站源码,ubuntu检查IP地址,tomcat7免装版配置,python爬虫神器app,php ay18d7 cn,seo浏览插件lzw

更改源码注册邀请码,ubuntu终端命令错误,浙江金华爬虫店, php,seo培训全套lzw

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。