here is the code
$sql = "SELECT * FROM $table ";
foreach ($db->query($sql) as $row) {
echo "<tr>"."
";
echo '<td>'. $row[CODE].'</td>';
echo '<td>'. $row[FIRME_CODE].'</td>';
echo '<td>'. $row[NOM_LEGAL].'</td>';
echo '<td>'. $row[NO_CIVIQUE].'</td>';
echo '<td>'. $row[NOM_RUE].'</td>';
.... and so on ...
echo "</tr>"."
";
}
the question, how it's possible to output all the value found from the query into a table WITHOUT having to tell each array table value individually...
it does not make sens... so there must be a way to do it, fast...
--
after changing it to this.. it output the word : Array in each table cell
<td> Array </td>... not good !
So the question is... what is the error in this code ?
$sql = "SELECT * FROM $table ";
$rows = $db->query($sql);
echo '<tr>';
foreach ($rows as $key => $value) {
echo '<td>', $key, '</td>';
}
echo '</tr>';