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

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