QueryBuilder
SELECT count( * ) as unitesCount, min(u.loyer) as min_loyer, GROUP_CONCAT(DISTINCT tu.nom ORDER BY tu.nom SEPARATOR ", ") as unites_nom FROM `unites` u LEFT JOIN `residences` r ON u.residence_id = r.id LEFT JOIN `types_unites` tu ON u.unite_id = tu.id WHERE residence_id = GROUP BY residence_id ORDER BY tu.nom;
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY residence_id ORDER BY tu.nom' at line 5
QueryBuilder
SELECT (SELECT count( * ) FROM proximite WHERE residence = ) as proximiteCount, (SELECT count( * ) FROM unites WHERE residence_id = ) as unitesCount, (SELECT count( * ) FROM emplois INNER JOIN emplois_temp ON emplois_temp.emploi=emplois.id LEFT JOIN residences ON emplois_temp.residence = residences.id WHERE affiche=1 AND possibilite=0 AND emplois_temp.residence= AND residences.emplois_masques = 0 AND emplois.approuve=1 AND emplois.confidentiel=0 AND emplois.datePublication <= NOW() AND emplois.pasDeResidence = '0') as emploisDisponiblesCount, (SELECT count( * ) FROM emplois INNER JOIN emplois_temp ON emplois_temp.emploi=emplois.id LEFT JOIN residences ON emplois_temp.residence = residences.id WHERE affiche=1 AND possibilite=1 AND emplois_temp.residence= AND residences.emplois_masques = 0 AND emplois.approuve=1 AND emplois.confidentiel=0 AND emplois.datePublication <= NOW() AND emplois.pasDeResidence = '0') as emploisPossibilitesCount, (SELECT count( * ) from activites WHERE approuve = '1' AND aff_local = '1' AND residence_id = ) as activitesCount
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') as proximiteCount, (SELECT count( * ) FROM unites WHERE residence_id = ) a' at line 2
QueryBuilder
SELECT type, nom, lat, lng, adressePage, prefixe, regionAdressePage, arrondissementAdressePage FROM (SELECT v.id, 'villes' as type, v.nom, v.lat, v.lng, v.adressePage, v.prefixe, r.adressePage as regionAdressePage, '' as arrondissementAdressePage from villes v LEFT JOIN regions r ON r.id = v.region WHERE v.id <> 0 union select a.id, 'arrondissements' as type, a.nom, a.lat, a.lng, a.adressePage, a.prefixe as prefixe, r.adressePage as regionAdressePage, '' as arrondissementAdressePage from arrondissements a LEFT JOIN villes v ON v.id = a.ville LEFT JOIN regions r ON r.id = v.region WHERE a.id <> 1 union select q.id, 'quartiers' as type, q.nom, q.lat, q.lng, q.adressePage, q.prefixe as prefixe, r.adressePage as regionAdressePage, a.adressePage as arrondissementAdressePage from quartiers q LEFT JOIN arrondissements a ON a.id = q.arrondissement LEFT JOIN villes v ON v.id = a.ville LEFT JOIN regions r ON r.id = v.region WHERE q.id <> 1 ) a ORDER BY ((a.lat - )*(a.lat - )) + ((a.lng - )*(a.lng - )) ASC LIMIT 3
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')*(a.lat - )) + ((a.lng - )*(a.lng - )) ASC LIMIT 3' at line 22