我使用这个https://github.com/ajillion/PHP-MySQLi-Database-Class
这是我的课
require_once ('class/MysqliDb.php');
class Foo {
private $db;
public function __construct()
{
$this->db = MySqliDb::getInstance();
}
}
public function register($password, $email) {
$password = @sha1($password);
$query = $this->db
->where('email', $email)
->get('users');
if (count($query) == 0)
{
$insertData = array(
'email' => $email,
'password' => $password
);
if($this->db->insert('users', $insertData)){
return true;
}
}else{
return FALSE;
}
}
我保存在 Db 中(如果count($query) == 0
),但我也收到此错误
( ! ) Notice: Undefined property: MysqliDb::$_paramTypeList in /.../class/MysqliDb.php on line 356
如果我不写这个查询
$query = $this->db
->where('email', $email)
->get('users');
我没有错误。我可以在单个函数中进行多查询吗?以及我是如何遇到这个错误的MysqliDb::$_paramTypeList