Aide pour afficher des donné dans un tableaux

Par FrenchGaming Team, il y a 10 ans


Bonjours,
Voila j'esaye de faire un tableaux avec les donnée de la base de donnée (username, password email). Et quand je fais un foreach rien ce passe. Pouriais vous m'aider ?

Voici un screen du tableaux :

Voici mon code :

<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example"> <thead> <tr> <th><b>&nbsp;ID&nbsp;</b></th> <th><b>&nbsp;Username :</b></th> <th><b>&nbsp;Password</b></th> <th><b>Email</b></th> <th><b>&nbsp;Supprimer&nbsp;</b></th> </tr> </thead> <tr> <?php foreach($req as $row): ?> <td>&nbsp;<?php echo $row->id; ?>&nbsp;</td> <td>&nbsp;''&nbsp;</td> <td>&nbsp;'.'&nbsp;</td> <td>&nbsp;''&nbsp;</td> <td>&nbsp;''&nbsp;</td> <td>&nbsp;<a href="addkey.php?action=delete&id='.htmlspecialchars($row->id).'">OK</a>&nbsp;</td> <?php endforeach;?> </tr> </table> $req = $db->query("SELECT * FROM licence ")->fetchAll();

Ma requete et fait comme ceci :

5 réponses

ADessi, il y a 10 ans

Salut, si tu fait un var_dump($req) tu obtiens quoi ?

FrenchGaming Team, il y a 10 ans

J'obtient toute les id username password de la base de donnée

ADessi, il y a 10 ans

remplace le <?php echo $row->id ?> par <?php var_dump($row) ?> et regarde ce que ça fait ...

FrenchGaming Team, il y a 10 ans

C'est bon j'ai trouvé . Sauf que sa s'affiche en hauteur voir screen aurais tu un tutoriel de pagination en utilisant PDO