When using count (*) php is returning the limit error reached. I have already changed my php.ini and set the value to 1000, but still continues to return error.
Count function
$this->db->query("SELECT COUNT(*) as total FROM ". db_table_prefix ."users");
DATABASE FUNCTION
public function query($sql, $args = [])
{
if (!$args)
return $this->query($sql);
$stmt = $this->pdo->prepare($sql);
$stmt->execute($args);
return $stmt;
}
Once try this transaction method. Hope it helps
public function query($sql, $args = [])
{
try{
//We start our transaction.
$pdo->beginTransaction();
if (!$args)
return $this->query($sql);
$stmt = $this->pdo->prepare($sql);
$stmt->execute($args);
$pdo->commit();
}
catch(Exception $e){
$pdo->rollBack();
}
return $stmt;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.