Bonjour à toutes et à tous,
En base de données MySQL, j'ai crée une table auth avec un auth_id, auth_login et auth_pass
Dans le code suivant, je souhaite me connecter à mon back office en récupérant l'auth_id de mon champ
Le retour de $nb_rows m'affiche 0
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 <?php include('variables.php'); include('fonctions.php'); ?> <html> <head> <title> Authentification Base de Données - Bordeaux Dating - Site de rencontre en Gironde</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/wsmail.css"/> <script type="text/javascript" src="js/jquery-1.4.4.js"></script> <script type="text/javascript" src="js/verif_connect.js"></script> </head> <body> <div class="container"> <img src="images/bordeauxdating.png"> <form name="formAuth" id="authForm" method="post" action="index.php" onsubmit='return verif_connect()'> identifiant <label for="identifiant"><input type="text" value="" size=20 maxlength=20 name="login" ></label> mot de passe <label for="password"><input type="password" value="" size=20 maxlength=20 name="pass"></label> <input type="submit" value="Connexion" name="valider" class="submit" /> </form> <?php $bdd=connexion(); $query=("SELECT auth_id FROM ".TABLE." WHERE auth_id='".$id."' "); $select=$bdd->prepare($query); $select->execute(); $result = $select->fetch(PDO::FETCH_OBJ); $nb_rows = $select->rowCount(); echo($nb_rows); ?> </div><!-- container --> </body> </html>
Merci d'avance.
Transact








Répondre avec citation


Partager