j'essaye de faire une requête sql avec plusieurs where et lorsque je l'exécute j'ai l'erreur
"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 'WHERE 'SIP/00.000.00.000-0003fa96' LIKE concat ('%',trunks.nomtrunk, '%') GROUP ' at line 1"
Quelqu'un aurait-il une idée de mon erreur? Les variables sont bien alimentées donc rien à voir avec ça !
Merci à tous de votre aide, voici mon code:
Code : Tout sélectionner
"SELECT trunks.nomtrunk, forfaits.destination_name, forfaits.prefixe, forfaits.prix_minute,SUM(forfaits.connection+ (forfaits.prix_minute * ".($dataline['billsec']/60).")) as$
" FROM trunks JOIN clients ON trunks.clients_id = clients.clients_id JOIN forfaits ON clients.forfaits_id = forfaits.forfaits_id".
" WHERE '".$dataline['dst']."' LIKE concat(forfaits.prefixe,'%')".
" AND WHERE '".$dataline['channel']."' LIKE concat ('%',trunks.nomtrunk, '%')".
" GROUP BY trunks.nomtrunk, forfaits.destination_name, forfaits.prefixe".
" ORDER BY forfaits.prefixe DESC LIMIT 1";
Code : Tout sélectionner
WHERE '".$dataline['dst']."' LIKE concat(forfaits.prefixe,'%')