2016-03-13, 03:08 PM
I'm working on a desktop to call my MyBB API and fetch all the files names from my MyBB database. How ever, I've ran into a corner and I am not sure how to solve my problem. this is my PHP code:
and the errors message:
Fatal error: Call to a member function query() on null in ..... on line 86
Line 86 is
$sql = "SELECT filename FROM `files`";
$query = $db->query($sql);
//$query = $db->simple_select("files", "filename");
//$files = $db->fetch_array($query);
if(!$files['filename']) {
return 0;
} else {
return $encryptionEngine->init($files['filename'],"encrypt");
}
and the errors message:
Fatal error: Call to a member function query() on null in ..... on line 86
Line 86 is
query = $db->query($sql);