演示代码报错?
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);这行代码一直报错?