Probleme sur tables jointes
Bonjour,
J'ai un problème dans ma requete et je n'arrive pas à le localiser...
Elle fonctionne parfaitement mais dès que je rajoute le complément de requete en rouge, elle plante.
[EDIT]
Après reflexion, je constate que j'ai oublié de lier la table societe_option en vert
Le message d'erreur reste le même, seule la ligne d'erreur change...
[/EDIT]
Les tables concernées:
Societe:
id
nom
Societe_option:
societe_id
option_id
option:
id
nom
Le message d'erreur:
Citation:
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 'option ON option.id=societe_option.option_id INNER JOIN ville ON ville.id=soc' at line 7
La requete:
Citation:
$sql = "
SELECT societe.nom AS NOMSOC, societe.url AS URLSOC, societe.adresse1 AS AD1SOC,
societe.adresse2 AS AD2SOC, societe.telephone AS TELSOC, societe.email AS EMASOC,
societe.text_pub_fr AS PUFSOC, societe.text_pub_en AS PUESOC, societe.commentaires AS COMSOC,
categorie.nom AS NOMCAT,ville.ville AS NOMVIL, ville.codepostal AS CODVIL, option.nom AS NOMOPT
FROM societe INNER JOIN societe_categorie ON societe.id = societe_categorie.societe_id
INNER JOIN categorie ON categorie.id = societe_categorie.categorie_id
INNER JOIN option ON option.id=societe_option.option_id
INNER JOIN societe_option ON societe.id=societe_option.societe_id
INNER JOIN ville ON ville.id=societe.ville_id
WHERE societe.vignette<>'no_vignette.png' AND categorie.nom='$categorie1' AND ville.ville LIKE '$multiville' ORDER BY societe.nom";
Quelqu'un voit il où se situe le problème?