I\'m trying to create a pagination class and use a variable from outside the class.
But it\'s giving me the fatal error \"Call to a member function query() on a non-
you could add the db-connection ($db) to the call of the get_records method:
$db
get_records
Here are only the relevant lines of code:
First file:
$records = $pagination->get_records("SELECT * FROM `table`", $db);
Second file:
public function get_records($q, $db) {