Bonjour je souhaite afficher les détails d'un étudiant enregistré dans une BDD MySQL mais j'ai un problème pour afficher la photo que j'upload dans un répertoire nommé photos. Voici mon code:
Et voici la BD
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
44
45
46
47
48
49
50 <?php if (isset($_GET['numero'])) { extract($_GET); connexionBD(); $requete = "SELECT * FROM etudiant WHERE idE LIKE '$numero'"; $resultat = mysql_query($requete); while($reponse=mysql_fetch_object($resultat)) { //extract($reponse); echo '<table style="width:100%; border-spacing:0;">'; echo " <tr> <td ROWSPAN='8' style=\"border-top: 1px solid #000000;\"> <img src='photos/,".$reponse->photoE.",' cellspadding='0' height='220' width='220' > </td> </tr> <tr> <th style=\"border-top: 1px solid #000000;\">Identifiant: </th> <td style=\"border-top: 1px solid #000000;\">".$reponse->idE."</td> </tr>"." <tr> <th style=\"border-top: 1px solid #000000;\">Nom: </th> <td style=\"border-top: 1px solid #000000;\">".$reponse->nomE."</td> </tr>"." <tr> <th style=\"border-top: 1px solid #000000;\">Prénom: </th> <td style=\"border-top: 1px solid #000000;\">".$reponse->prenomE."</td> </tr>"." <tr> <th style=\"border-top: 1px solid #000000;\">E-mail: </th> <td style=\"border-top: 1px solid #000000;\">".$reponse->emailE."</td> </tr>"." <tr> <th style=\"border-top: 1px solid #000000;\">Date de naissance: </th> <td style=\"border-top: 1px solid #000000;\">".$reponse->dNaissE."</td> </tr>"." <tr> <th style=\"border-top: 1px solid #000000;\">Genre: </th> <td style=\"border-top: 1px solid #000000;\">".$reponse->genreE."</td> </tr>"." <tr> <th style=\"border-top: 1px solid #000000;\">Code de la classe: </th> <td style=\"border-top: 1px solid #000000;\">".$reponse->codeC."</td> </tr>"; echo"</table>"; } } ?>
Merci pour votre aide.
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 CREATE TABLE IF NOT EXISTS `etudiant` ( `idE` tinyint(4) NOT NULL AUTO_INCREMENT, `nomE` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `prenomE` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `emailE` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `dNaissE` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `genreE` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `photoE` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `codeC` tinyint(4) NOT NULL, PRIMARY KEY (`idE`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=16 ; -- -- Contenu de la table `etudiant` -- INSERT INTO `etudiant` (`idE`, `nomE`, `prenomE`, `emailE`, `dNaissE`, `genreE`, `photoE`, `codeC`) VALUES (1, 'NOEL', 'Louis', 'louisnoel@gmail.com', '1989-03-20', 'Masculin', 'photo_260720120522.jpg', 1);
Partager