$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()能正常执行。