phpsql存储过程
$sql='create procedure t7() select * from tb_article ';
$dbh=new pdo($dsn, 'lms', '123456');
$stmt=$dbh->query('call t1()');
// $stmt=$dbh->prepare('CALL t1()');// $stmt->execute();if($stmt){ $rs=$stmt->fetchAll();}else{ echo '没有查询结果';}
使用query和execute方法都不行,返回结果是false。
存储过程在PHPmyadmin上能正常执行。我在phpmyadmin上执行call t1()能正常执行。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号