[Conception] "while" et "if' sont sur un bato
bonjour
voila j'ai une liste de block avec un élément vue qui un integer
si il est égale a 1 alors je veux écrire "Oui" sinon "Non"
mais il m'écrit libéllé que le premier sur tous les enregistrements
pourquoi ?? d'avance merci
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| //Liste des blocks
$sql="SELECT * from block ORDER BY position";
$req=mysql_query($sql) or die ("Erreur SQL ! : ". $sql ."<BR>". $mysql_error());
echo"<div class=\"admin_titre\">Liste des blocks</div>\n";
echo"<table border=\"1\" width=\"100%\">\n";
echo"<th>Nom</th><th>Page</th><th>Visible</th><th>Lien</th>\n";
while($data=mysql_fetch_assoc($req)){
echo"<tr><td>". $data['nom'] ."</td><td>" .$data['page']."</td><td>";
if($data['vue']=0){
echo"Oui";
}else{
echo"Non";
}
echo"</td>"
."<td><a href=\"?action=admin&type=upBlock&id=". $data['id']."\"><img src=\"images/up1.gif\" alt=\"\"></a> <a href=\"?action=admin&type=downBlock&id=" .$data['id'] ."\"><img src=\"images/down1.gif\" alt=\"\"></a> "
."<a href=\"?action=admin&type=editBlock&id=". $data['id']."\"><img src=\"images/modif.gif\" alt=\"\"></a> <a href=\"?action=admin&type=delBlock&id=". $data['id'] ."\"><img src=\"images/delete.gif\" alt=\"\"></a></td></tr>\n";
}
echo"</table>\n"; |