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


JMERISE
Réponse acceptée

Salut il y a un tuto pour la pagination sur ce lien si tu veux => https://www.primfx.com/article/tuto-php-systeme-pagination-182

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

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

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

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