ManuAntibes
Messages postés491Date d'inscriptionmardi 24 octobre 2000StatutMembreDernière intervention18 novembre 2021
-
11 sept. 2011 à 15:50
ManuAntibes
Messages postés491Date d'inscriptionmardi 24 octobre 2000StatutMembreDernière intervention18 novembre 2021
-
11 sept. 2011 à 19:06
Bonjour
J'ai une recherche a faire dans une base de donnée.
j'ai 2 tables.
Table1 = liste client
Idclient
Nom
Prenom
Telephone
Table2 = Commande
Idcommande
Idclient
ViandeSemaine = "Veau, Sem 33"
je veux afficher dans un tableau, la liste des clients qui n'on pas de commande sur "Veau, Sem 33".
j'ai fais ce code qui affiche les clients qui on commander du "Veau, Sem 33"
$query_Lclient sprintf("SELECT `IdClient` , `Nom` , `Prenom` , `Telephone` , `Portable` , `ViandeSemaine` FROM `listecompte` INNER JOIN `Commande` ON `IDListecompte` `IdClient` WHERE `ViandeSemaine` = '".$_POST['SelectPanier']."' GROUP BY idclient ORDER BY `idclient` ASC");
je souhaite faire le contraire,
Si je mets WHERE `ViandeSemaine` <> '".$_POST['SelectPanier']."'
Cela m'affiche les clients qui on pris les autres viandes et les autres semaine.
Comment faire pour afficher ce qui n'ont pas commander en fonction '".$_POST['SelectPanier']."'
ManuAntibes
Messages postés491Date d'inscriptionmardi 24 octobre 2000StatutMembreDernière intervention18 novembre 20215 11 sept. 2011 à 19:06
salut
j'ai cette erreur:
#1064 - 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 'OUTER JOIN `Commande` ON `IDListecompte` `IdClient` WHERE `ViandeSemaine` ' at line 1
Vous mettez
WHERE tb1.id IS NULL
OR tb2.id IS NULL
je rajout après
AND `ViandeSemaine` = '".$_POST['SelectPanier']."'