我得到了两次“$field_value”——但为什么?正常的结构是:<id><name><address><email>
但现在我明白了<id><id><name><name><address><address><email><email>
这是代码:
<tbody>
<?php
$STH = $DBH->prepare("SELECT * FROM kunden");
$STH->execute();
$result = $STH->fetchall();
foreach($result as $key => $inner_arr) {
echo '<tr>';
foreach($inner_arr as $field_name => $field_value) {
echo "<td>{$field_value}</td>";
}
echo '</tr>';
}
?>
</tbody>