I'm getting an error in PHP on a valid query, which executes fine when run directly from PHPMyAdmin.

Has anyone had a similar problem before and could point me in the right direction?

The error is below along with the function used the execute the query.

PHP Code:
Array
(
    [
Error] => Invalid Query SELECT FROM users ORDER BY userDeleted ASCuserFullname ASC
)
Array
(
    [
Error] => Empty MySQL resource.
)

public function 
query($q){
        if(empty(
$q)) $this->dbError('Empty MySQL Query.');
        if(
$this->linkID == 0$this->connect();
        
$temp = @mysql_query($q$this->linkID);
        if(!
$temp$this->dbError('Invalid Query : '.mysql_error().'<br />'.$q);
        return 
$temp;

}

public function 
getUsers(){
    
$q "SELECT * FROM users ORDER BY userDeleted ASC, userFullname ASC";
    
$result $this->query($q); 
Cheers,
Rhys