There is an error on the SQL command.

SQL:
select p.*, t.town, c.county from geo_towns t, geo_counties c, geo_regions r, pubs p where p.pub_town = t.id and t.county_id = c.id and c.region_id = r.id and p.pub_online = 1 and p.pub_active = 1 and p.pub_id = '4057-Lawlors-Hotel'

Error:
Access denied for user 'apache'@'localhost' (using password: NO)