PHP尝试使用类,但无法访问类

I'm trying to create a class with a function in one php file, and the access it from another. But I can't get it to work. I get Fatal error: Class 'databaseConnect' not found.

The code:

    <?php
        $conn = new mysqli("localhost", "root", "usbw", "beoordelingen") or die(mysql_error());

        class database {
            public function getDatabase($theVar, $theSelector,  $theLocator) {
                $theVar = $conn->query("SELECT $theSelector FROM beoordeling $theLocator");
            }
        }

    ?>

Then trying to call it in another file:

<?php
        include("myClassFile.php");

            $index = new database();

            $index->getDatabase($result, "DISTINCT `category`");
?>

Does it have something to do with scope or namespace? Or am I just doing something wrong here.

(1) check whether the file exists. you'd better use absolute path as well.

(2) whether there is a namespace scope. try new \databaseConnect(); append a back-slash