ERROR function nb_result() in Search Apartment ID :
SELECT COUNT(DISTINCT apartment.id ) AS total_entries FROM apartment left join virtual_tour ON apartment.id = virtual_tour.apt_id left join apartment_service ON apartment.id = apartment_service.id_apartment left join building_service ON apartment.id = building_service.id , building, zone, borough, pricing WHERE apartment.building_id = building.id AND building.zone_id = zone.id AND zone.borough_id = borough.id AND pricing.apt_id = apartment.id AND apartment.display='1' AND zone.id = '3051783'

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)