How can I make something like this (add something to a SELECT command):

```
 $query = "SELECT a.name,a.surname,b.email,c.phone 
           FROM users as a 
           inner join users_email as b 
           inner join users_phone as c
           WHERE a.id=b.id AND a.id=c.id";

 $query .= "ORDER BY a.surname";  

 $result = mysql_query($query,$con);

```

The result should be: 

```
$query = "SELECT a.name,a.surname,b.email,c.phone 
          FROM users as a 
          inner join users_email as b 
          inner join users_phone as c
          WHERE a.id=b.id AND a.id=c.id
          ORDER BY a.name";   

$result = mysql_query($query,$con);
$row=mysql_num_fields($result)

```

...but it gives an error: mysql\_num\_fields() expects parameter 1 to be resource, boolean given in C:\xampp-portable\htdocs\db\file.php on line 32...