I've got a problem that needs fixing and I can't seem to figure it out.
So, I use this method (part of method that's troublesome) to get total users when listed for pagination:
$up = Users::totalUsers($condition);
$totalPages= ceil($up / App::config('rps'));
`
Then I go to model and count everyone:
public static function totalUsers($condition)
{
$conn= DB::getInstance();
$exp= $conn->prepare('
select count(id) from users where concat(name,\'\',
surname,\'\',email,\'\',username)
like :condition
');
$condition= '%' . $condition. '%';
$exp->bindParam('condition',$condition);
$exp->execute();
return $exp->fetchAll();
}
Tried adding PDO::PARAM_INT like
('condition',$condition,PDO::PARAM_INT)
but it also doesn't work.