mano2003

Inscris le 01/08/2012 à 02:12
  • Signature
    Mano
  • Nombre de sujets
    1
  • Nombre de messages
    1
  • Nombre de commentaires
    Aucun
  • Nombre de news
    Aucune
  • Niveau en PHP
    Débutant

Ses derniers messages sur les forums

mano2003
le 01/08/2012 à 02:39
Problème d'affichage d'une photo stockée dans une BDD MYSQL
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:
<?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>";
}
}
?>

Et voici la BD
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);


Merci pour votre aide.
Mano
LoadingChargement en cours