[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [linux-team] MySQL & Php3
J'essaierai:
$result = mysql_query("
SELECT * FROM clients left join pays on
clients.pay_id=pays.pay_id
where clients.cli_prenom like '%$prenom%'
and clients.cli_nom like '%$nom%'
"
,"$db");
OU
$result = mysql_query("
SELECT * FROM clients left join pays on
clients.pay_id=pays.pay_id
where clients.cli_prenom like '%$prenom%'
and clients.cli_prenom like '%$nom%'
"
,"$db");
si on veut rechercher dans le meme champs cad prenom.
jm
-----Original Message-----
From: owner-linux-team@rtfm.be [mailto:owner-linux-team@rtfm.be]On
Behalf Of MailingList Linux Team
Sent: mardi 9 novembre 1999 10:27
To: linux-team@rtfm.be
Subject: [linux-team] MySQL & Php3
Les gurus d'SQL vont aimer...
Je ne parviens pas à utiliser correctement plus d'une variable lors d'une
requete sur une db MySQL en utilisant le code suivant dans un script php3
$result = mysql_query("SELECT * FROM clients left join pays on
clients.pay_id=pays.pay_id where clients.cli_prenom like \"%$prenom%\" and
\"%$nom%\"","$db");
J'ai essayé différentes combinaisons mais sans résultat... :-( Quand je
n'utilise que le prénom c'est OK, mais si j'utilise le nom, il me sort
tout les records...
Le but est de pouvoir faire une recherche dans la DB à l'aide de plusieurs
champs.
Une idée ?
Merci
Hugues MERTENS
---------
Visit the Linux Supertore Online: http://www.redcorp.com !
If you want to be deleted from the list, send a mail to
majordomo@rtfm.be with "unsubscribe linux-team" in the body.
Archive of the list: http://tania.be.linux.org/
---------
Visit the Linux Supertore Online: http://www.redcorp.com !
If you want to be deleted from the list, send a mail to
majordomo@rtfm.be with "unsubscribe linux-team" in the body.
Archive of the list: http://tania.be.linux.org/