使用pdo怎么实现登录
错误Fatal error: Uncaught Error: Call to a member function fetchAll() on null in F:\xampp\htdocs\shopDxg\shopDxg\lib\mysql.func.php:116 Stack trace: #0 F:\xampp\htdocs\shopDxg\shopDxg\lib\mysql.func.php(96): PdoMySQL::fetchAll('SELECT * FROM u...') #1 F:\xampp\htdocs\shopDxg\shopDxg\core\admin.inc.php(7): PdoMySQL::find('user', NULL, '*', NULL, NULL, NULL, NULL) #2 F:\xampp\htdocs\shopDxg\shopDxg\admin\doLogin.php(15): checkAdmin('user', NULL) #3 {main} thrown in F:\xampp\htdocs\shopDxg\shopDxg\lib\mysql.func.php on line 116
代码
// 得到结果集中所有记录 ...
public static function fetchAll($sql=null)
{
if($sql!=null){
self::query($sql);
}
$result=self::$PDOStatement->fetchAll(constant("PDO::FETCH_ASSOC"));
return $result;
}