PDO加载模块成功,但是我在写查询语句的时候
$sql = 'select * from table where id=:id';
$sth = $dbh->prepare($sql);
$sth->execute(array(':id' =>1));
运行出现下面错误
Fatal error: Call to a member function prepare() on a non-object in。。。。。index.php on line 7
...全文
3673打赏收藏
pdo 中prepare怎么用
PDO加载模块成功,但是我在写查询语句的时候 $sql = 'select * from table where id=:id'; $sth = $dbh->prepare($sql); $sth->execute(array(':id' =>1)); 运行出现下面错误 Fatal error: Call to a member function prepare() on a non-object in。。。。。index.php on line 7