Question: Hey stackoverflow community, I've got question, I'm getting this error:

> 
> **Fatal error**: Class 'DBQuery' not found in
> 
> 
> 

And, if I know that this class is written in query.class.php file. How can i fix this error? I've never done this before, so I thought you guys could help me? This is what am i trying to do:

```
$q = new DBQuery;
$q->addQuery("ut.user_id, perc_assignment, concat_ws(', ', contact_last_name, contact_first_name) as contact_name");
$q->addTable('user_tasks', 'ut');
$q->leftJoin('users', 'u', array('user_id'));
$q->leftJoin('contacts', 'c', 'c.contact_id = u.user_contact');
$q->addWhere('task_id ='.$task_id.' AND task_id <> 0');
$assigned_perc = db_loadHashList($q->prepare(true), 'user_id');

```

So should i use:

```
require('query.class.php');

```

Or something?

Answer: 
if you have defined `class DBQuery` in your `query.class.php` file then yes, include that file before using it. If you dont, then declare that class before using it
If you do not include your Class file, obviously when you try to instantiate that class it will fail with the above error. require (/path/to/class.php); will probably do the job in your case!