Counter nombre de client boucle while
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <tbody>
<?php
$req = $db->prepare("SELECT * FROM user, information_user WHERE user.id_user = information_user.id_user");
$req->execute();
while($result = $req->fetch(PDO::FETCH_ASSOC)) : ?>
<tr>
<td><?= "CO00" . $result["id_user"] ?></td>
<td><?= $result["first_name"] ?></td>
<td><?= $result["last_name"] ?></td>
<td><?= $result["company_name"] ?></td>
<td><?= $result["num_phone"] ?></td>
<td><?= $result["num_cell"] ?></td>
<td><?= $result["email_user"] ?></td>
<td><button class="edit">Modifier</button><button class="view">Voir</button></td>
</tr>
<?php endwhile ?>
</tbody>
<tfoot>
<tr>
<td colspan="8">Total Client:<?= count($result["id_user"]); ?> </td>
</tr>
</tfoot> |