My first suggestion would be to only retrieve the fields you actually need, instead of using the "*" to retrieve everything. Where needed, you could then assign an alias to make it easier to reference it:
$sql = "SELECT c.id AS company_id, c.another_field, f.some_field <etc....>
FROM csite_companies c
LEFT JOIN csite_filerefs f ON ( c.id = f.compid )
LEFT JOIN csite_locations l ON ( c.id = l.compid ) WHERE
LIMIT 0 , 30";
//
// ...
//
$company['id'] = $results['comapny_id'];
This also has the advantage of only retrieving the data you need, rather than every field from every table, thus decreasing the time and memory needed transfer data between MySQL and your script.