您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP,用PDO调用MYSQL存储过程的问题

2024/4/8 23:43:48发布14次查看
mysql里有个存储过程,比如有2个in,3个out。
php里用pdo的方式调用这个存储过程,怎么将3个返回值存到一个数组中。谢谢。
$dsn = $dbms:host=$host;dbname=$dbname;
$pdo = new pdo($dsn,$username,$password);
$pdo -> query(set names uft8);
$_query=call testproreg('a','b');
$result=$pdo->prepare($_query);
$result->execute();
接下来应该怎么办呢?谢谢大家了!
回复讨论(解决方案) http://php.net/manual/zh/pdostatement.bindparam.php #3
班主说的那个不好用的.手册里面的那个范例不好使,我测试过了,连存储过程都没调用成功啊.
prepare('call puree_fruit(?)');$sth->bindparam(1, $colour, pdo::param_str|pdo::param_input_output, 12);$sth->execute();print(after pureeing fruit, the colour is: $colour);?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product