Bonjour à tous et je vous souhaite un bon Lundi !
Dès le lundi matin (dur ! ) petit soucis avec ma requête sql. J'ai voulu rajouter un simple WHERE et bim ça me marque
"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.000.00-0003fa96' LIKE concat ('%',trunks.nomtrunk, '%') GROUP ' at line 1"
Bref quand j'enlève mon premier where ça marche. Peut être une erreur dans la syntaxe? Mes variables aucun soucis elles fonctionne bien donc ça vient vraiment du code...
Si jamais vous avez une petite idée ça serait gentil
Je bosse sur une BDD mysql avec php et sql mais mon problème est bien sur cette requête:
Bon courage à tous pour ce premier jour après le week end ! ! ! !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 "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";
Partager