-2

It is my code:

    public function getEmployees($where='1',$start, $perPage){
    $sql="SELECT e.name,e.birthday,d.title_dep,p.title_pos,t.title_type,e.salary FROM `employees` AS e INNER JOIN departments AS d ON e.id_dep=d.id
  INNER JOIN positions AS p ON e.id_pos=p.id
  INNER JOIN payment_types AS t ON e.id_type=t.id  where ".$where. 'LIMIT 10';

I always get error: Call to a member function fetch_all() on boolean

It began when I added 'LIMIT 10'. Whithout it my code works fine. How can I solve my problem?

1 Answers1

0

If you echo the $sql variable you would likely see the problem. As aynber points out, you need a space before LIMIT 10

Duane Lortie
  • 1,282
  • 1
  • 12
  • 16