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 =

Error:
Too many connections