PHP头条
热点:

php-[PHP]wamp环境下。使用PDO连接mysql,能执行查询的sql,不能调用存储过程


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()能正常执行。图片说明

www.phpzy.comtrue/phpyy/1713.htmlTechArticlephp-[PHP]wamp环境下。使用PDO连接mysql,能执行查询的sql,不能调用存储过程 phpsql存储过程 $sql='CREATE PROCEDURE t7() select * from tb_article '; $dbh=new PDO($dsn, 'lms', '123456'); $stmt=$dbh->query('CALL t1()');...

相关文章

相关频道:

PHP之友评论

今天推荐