BindParam avec WHERE ? = ?
Résolu/Fermé
kitsuo
Messages postés
24
Date d'inscription
dimanche 8 janvier 2012
Statut
Membre
Dernière intervention
13 mars 2017
-
Modifié par kitsuo le 3/06/2014 à 13:46
kitsuo Messages postés 24 Date d'inscription dimanche 8 janvier 2012 Statut Membre Dernière intervention 13 mars 2017 - 3 juin 2014 à 14:11
kitsuo Messages postés 24 Date d'inscription dimanche 8 janvier 2012 Statut Membre Dernière intervention 13 mars 2017 - 3 juin 2014 à 14:11
A voir également:
- BindParam avec WHERE ? = ?
- Where is appdata - Guide
- Where is hiberfil.sys - Guide
- Where is host file - Guide
- Where Is It? - Télécharger - Gestion de fichiers
- Where am i right now exact address - Guide
1 réponse
kitsuo
Messages postés
24
Date d'inscription
dimanche 8 janvier 2012
Statut
Membre
Dernière intervention
13 mars 2017
3 juin 2014 à 14:11
3 juin 2014 à 14:11
Trouvé u_u..!
Enfait j'avais pas besoin d'utiliser bindParam, les variables suffisent pour ce que je veux faire.
Je partage au cas où il y aurait d'autres qui rencontrent ce problème :).
Enfait j'avais pas besoin d'utiliser bindParam, les variables suffisent pour ce que je veux faire.
Je partage au cas où il y aurait d'autres qui rencontrent ce problème :).
$test = $_SESSION['id_hopital_user']; $opt2 = 'ho.id_hopital'; $opt1 = $test; $opt3 = '""'; $opt4 = '""'; echo $opt1 . " " . $opt2 . " " . $opt3 . " " . $opt4; $req = $bdd->prepare("SELECT DISTINCT nom_antidote, lot, date_peremption, date_inventaire, nom_ville, nom_hopital, tel_hopital FROM stocks AS st JOIN antidotes AS an ON st.id_antidote = an.id_antidote JOIN hopitaux AS ho ON st.id_hopital = ho.id_hopital JOIN services AS se ON st.id_service = se.id_service JOIN villes AS vi ON ho.id_ville_hopital = vi.id_ville JOIN departements AS de ON vi.departement_ville = de.id_dep JOIN regions AS re ON de.id_region_dep = re.id_region JOIN hopitaux_has_services AS hhs ON ho.id_hopital = hhs.hopitaux_id_hopital AND se.id_service = hhs.services_id_service WHERE " . $opt2 ." = ". $opt1 . " AND ". $opt3 ." = ". $opt4 ." ORDER BY st.date_peremption;");