Welcome Guest, Not a member yet? Register   Sign In
paginate/pagination ERROR
#1

(This post was last modified: 06-01-2021, 02:07 AM by John mark bartholomon.)

PHP Code:
How do you use paginate() in ci4 accompanied by query()
//situation
I am trying to use the paginate() accompanied with the query() but i get error messages i tried to do one with only the model using paginate(SETUP1). I also tried to do it with only the controller(SETUP2). But both give me the same error message
CodeIgniter
\Database\MySQLi\Result::paginate()

!
SETUP1
//PART OF MY CONTROLLER
        $data["SearchData"] = $model->searchAll($sendData);
        $data["pager"] = $model->pager;

//PART OF MY MODEL(It is inside the searchAll() function)
        $query $db->query($sql)->paginate(10);
        $query->getResultArray();
        $query->sql $sql;

        return $query;
 
//error
  Call to undefined method  CodeIgniter\Database\MySQLi\Result::paginate() 


 !
SETUP2
 
//PART OF MY CONTROLLER
  $data["SearchData"] = $model->searchAll($sendData)->paginate(10);
  $data["pager"] = $model->pager;

 
//PART OF MY MODEL(It is inside the searchAll() function)
  $query $db->query($sql);
  $query->getResultArray();
  $query->sql $sql;

  return $query;

 
//(same)error
 
Call to undefined method CodeIgniter\Database\MySQLi\Result::paginate()

 
// How do I fix/make a workaround this error any  suggestions/reccomendations/help will be appreciated thank you  :) . 
Reply


Messages In This Thread
paginate/pagination ERROR - by John mark bartholomon - 06-01-2021, 01:00 AM
RE: paginate/pagination ERROR - by InsiteFX - 06-01-2021, 05:25 AM
RE: paginate/pagination ERROR - by paliz - 06-02-2021, 05:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB