Une seul ligne a mon tableau php

X-AngeluS-X
Invité n'ayant pas de compte PHPfrance

14 juin 2010, 10:21

Bonjour a tous et bon début de semaine a tous après se beau weekend ensoleiller me voila en se lundi matin avec une beau problème php. Donc voila je chercher a faire générer un tableau en php donc le contenue provient d'une base de donnée sql normal qui a déjà un contenue et tout et tout. Le soucie c que depuis que j'ai demander a faire entrer le contenue dans le tableau celui si n'affiche plus que sa premier ligne .... sa me pose donc un gros gros soucie. Donc voila le code concerner minimal bien sur se n'est que celui qui concerne le tableau:
<?php
echo"</tr>";
echo"</tread>";
echo"<tbody>";

try
{
	$bdd = new pdo('mysql:host='.$add.';dbname='.$dbname.'', ''.$login.'', ''.$password.'');
	}
catch (Exception $e)
{
        die('Erreur : ' . $e->getMessage());
}
$reponse = $bdd->query( 'SELECT id_heuredebut, descriptif_heuredebut FROM heure_debut' ) or die(print_r($bdd->errorInfo()));;
while ($donnees = $reponse->fetch())
{
echo'<tr>';
							$i=0;
							 echo'<th>'.$donnees['descriptif_heuredebut'].'</th>';
							 $heure=$donnees['id_heuredebut'];
								for($i=0; $i<=6; $i++)
								{
									
								list($jour, $mois, $annee) = explode('/', date("d/n/Y"));
								 $timestamp= mktime(0, 0, 0, $mois, $jour+$i, $annee);
								 list($jour, $mois, $annee) = explode('/', date("d/n/Y", $timestamp));
								 $date_surveillance="$annee-$mois-$jour";
										echo'<td>';
										
								
										 $reponse=$bdd->query("select id_batiment from attribuer WHERE id_Surveillant='$surveillant' and date_surveillance='$date_surveillance' and  id_heuredebut='$heure' ") or die(print_r($bdd->errorInfo()));;
										 
										 while ($donnees = $reponse->fetch())
										{
										 $id= $donnees['id_batiment'];
										 $reponse=$bdd->query("select descriptif from batiment where id_Batiment='$id' ");
												while ($donnees = $reponse->fetch())
												{
												echo $donnees['descriptif'] ;
												  
												}
										  
										 }
										echo'</td>';
								}

echo'</tr>';
 }
$reponse->closeCursor();
echo"</tbody>";
echo"</table>";
?>
Le résultat obtenue :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
   <head>
       <title>Ajout Horaire</title>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	   <link rel="stylesheet" media="screen" type="text/css" title="test" href="style.css" />
   </head>

<body>

 Ajout terminer<p>Cliquez <a href="./ajouthoraire.php">ici</a> pour revenir à la page Ajout des horaires</p><table><caption>Laval Jerem</caption><tread><tr><th>Horaire/Jour</th><th>Lundi 14 juin 2010</th><th>Mardi 15 juin 2010</th><th>Mercredi 16 juin 2010</th><th>Jeudi 17 juin 2010</th><th>Vendredi 18 juin 2010</th><th>Samedi 19 juin 2010</th><th>Dimanche 20 juin 2010</th></tr></tread><tbody><tr><th>08H00</th><td>EXTERNAT B</td><td>EXTERNAT B</td><td></td><td></td><td>EXTERNAT B</td><td></td><td></td></tr></tbody></table>

</body>
</html>
Une solution pour le pauvre noob que je suis ? merci d'avance pour vos réponses. :p