I have several folders: 

* `localhost/mysite/inlcudes`
* `localhost/mysite/public`

... and inside includes, several files: 

* `database.php`
* `config.php`

Inside `database.php`, I have created a class to handle all the connection stuff. I created a database object. I tested the connection and queries using `test.php` in the same folder. Everything works fine, but when I try to test `database.php` in `public/index.php` it tells me the variable is not set.

**Code:**

```
<?php
include ('../../includes/database.php');

if (isset($database)) {
   echo"working";
} else {
   echo "not";
}

```

**Result:**

```
not

```