Remplir un tableau HTML dynamiquement
Bonjour,
J'ai crée une fonction pour récupérer les données d'une table de ma DB.
Code:
1 2 3 4 5 6 7 8 9 10 11
| public function getLRUlist() {
$cnx = new DataBaseManager();
$result = $cnx->query("SELECT `ID_LRU` FROM `lru` WHERE `LRU` ='" . $LRU . "'");
// var_dump($result);
echo "<table>";
while ($data = $result->fetch()) {
echo "<tr><td>".($data['LRU'])."</td></tr>";
}
echo "</table>";
} |
Je ne comprends pas comment changer le code HTML pour qu'il prends en compte les données. En fait j'ai appelé la fonction dans le HTML mais il ne prends en compte les modifications.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <div class="box-body">
<div id="idArticle" style="min-width: 310px; height: 550px; margin: 0 auto; overflow:auto">
<table class="table">
<thead>
<tr>
<th>Article</th>
<th>{{widget['0']|raw}}</th>
<th>{{widget['1']|raw}}</th>
<th>Current Trend</th>
</tr>
</thead>
<tbody>
<tr class="danger">
<td>{{widget['17']|raw}}</td>
</tr> |
Q'est-ce-que je dois changer à votre avis s'il vous plait pour que je puisse afficher mes données dans le tableau ?
Merci.