Récupérer une variable postée par formulaire

Fermé
t1t1 - 18 juin 2003 à 15:41
maily Messages postés 7556 Date d'inscription lundi 26 juin 2000 Statut Contributeur Dernière intervention 23 juin 2023 - 18 juin 2003 à 16:03
bjr
je voudrai intégrer une variable, posté par formulaire, dans le where d'un select.
pb de syntaxe, je n'obtient rien à l'affichage

$req = 'select champ1 from tab where champ1 = "$var" ';

merci

3 réponses

maily Messages postés 7556 Date d'inscription lundi 26 juin 2000 Statut Contributeur Dernière intervention 23 juin 2023 453
18 juin 2003 à 15:48
Bonjour
tiens, essaye ca
$req = 'select champ1 from tab where champ1 = '.$var;


S'il n'y a pas de solutions, c'est qu'il n'y a pas 
de pbs!! Maily   :-))))
0
$sql = 'SELECT champ1 FROM tab1 where champ1= "'.$var.'"';

ta soluce n'a pas marcher, par contre j'ai trouver ca
et ca fonctionne
merci

t1t1
0
maily Messages postés 7556 Date d'inscription lundi 26 juin 2000 Statut Contributeur Dernière intervention 23 juin 2023 453
18 juin 2003 à 16:03
Oui, c'est une chaine de caractères!!!
forcément il faut rajouter les ""

S'il n'y a pas de solutions, c'est qu'il n'y a pas 
de pbs!! Maily   :-))))
0

Discussions similaires