private function _isUsernameExists($username){ $sql = 'SELECT * FROM `user` WHERE `username`=:username'; $stmt = $this->_db->prepare($sql); $stmt ->bindParam(':username',$username); $stmt ->execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); return !empty($result); }
$stmt = $this->_db->prepare($sql);这行代码一直报错?
报什么错。一般报错应该是你pdo_myqsl扩展没开
Fatal error: Call to a member function bindParam() on a non-object in C:\UPUPW_AP5.5\vhosts\api.com\lib\User.php on line 72
出现了这个错误;
找到问题了,谢谢
代码没毛病, 看看是不是其他问题