MyBB Community Forums

Full Version: MyBB API fetch all fileNames from my table in my MyBB database.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:


        $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);