par
ephemere » 03 avr. 2006, 14:29
J'ai vraiment du mal aujourd'hui...
Quand tu écris $id=>$valeur je comprend "lorsque $id est plus grand ou égal à $valeur"...Or $id correspond à des chiffres et $valeur à un mot, en l'occurence détail, donc ça ne veut rien dire du tout...
j'tenvoi mon bout de code si ça peut t'aider a m'expliquer...:
<?php
$req = mysql_connect("odin","root","***********") or die(mysql_error());
//séléction de la BD
$req = mysql_select_db("gii");
$sql = "SELECT Id_incidents, Type_incidents, Lieux_incidents, Date_signalement,Commentaire_signalement FROM ......."; ?>
<table width="80%" border="0">
<tr bgcolor="#0000CC">
<th width="10%"><span class="Style1">ID</span></th>
<th width="20%"><span class="Style1">Type</span></th>
<th width="30%"><span class="Style1">Date</span></th>
<th width="22px"><span class="Style1">Lieu</span></th>
<th width="17"><span class="Style1">Etat</span></th>
<th width="13"><span class="Style1">Par</span></th>
</tr>
</table>
<?php
$resultSet = mysql_query($sql);
echo '<table width="80%" >' ;
while ($row = mysql_fetch_array($resultSet)) {
?>
<tr>
<td width="10%"><?php echo $row['Id']?></td>
<td width="20%"><?php echo $row['Type']?></td>
<td width="30%"><?php echo $row['Date_signalement_']?></td>
<td width="15%"><?php echo $row['Lieux']?></td>
<td width="20%"><?php echo $row['Signalé_par']?></td>
<td><input type="submit" name="bouton['.$row['Id'].']" value=Détail / /></td>
</tr>
<?php }
echo '</table>'; // on ferme le tableau
?>
voila..
le premier tableau sert de première ligne.
En tout cas merci de m'accorder de ton temps!

J'ai vraiment du mal aujourd'hui...
Quand tu écris $id=>$valeur je comprend "lorsque $id est plus grand ou égal à $valeur"...Or $id correspond à des chiffres et $valeur à un mot, en l'occurence détail, donc ça ne veut rien dire du tout... :?
j'tenvoi mon bout de code si ça peut t'aider a m'expliquer...:
[php]<?php
$req = mysql_connect("odin","root","***********") or die(mysql_error());
//séléction de la BD
$req = mysql_select_db("gii");
$sql = "SELECT Id_incidents, Type_incidents, Lieux_incidents, Date_signalement,Commentaire_signalement FROM ......."; ?>
<table width="80%" border="0">
<tr bgcolor="#0000CC">
<th width="10%"><span class="Style1">ID</span></th>
<th width="20%"><span class="Style1">Type</span></th>
<th width="30%"><span class="Style1">Date</span></th>
<th width="22px"><span class="Style1">Lieu</span></th>
<th width="17"><span class="Style1">Etat</span></th>
<th width="13"><span class="Style1">Par</span></th>
</tr>
</table>
<?php
$resultSet = mysql_query($sql);
echo '<table width="80%" >' ;
while ($row = mysql_fetch_array($resultSet)) {
?>
<tr>
<td width="10%"><?php echo $row['Id']?></td>
<td width="20%"><?php echo $row['Type']?></td>
<td width="30%"><?php echo $row['Date_signalement_']?></td>
<td width="15%"><?php echo $row['Lieux']?></td>
<td width="20%"><?php echo $row['Signalé_par']?></td>
<td><input type="submit" name="bouton['.$row['Id'].']" value=Détail / /></td>
</tr>
<?php }
echo '</table>'; // on ferme le tableau
?> [/php]
voila..
le premier tableau sert de première ligne.
En tout cas merci de m'accorder de ton temps! :lol: :lol: