我的问题是为什么它不显示 $aantalkeermenu。但它显示查询中的另一个变量可以帮助我吗?
这是我的查询:
$sql = "SELECT res.reserveringsnr, res.datum, menr.reserveringsnr, menr.menunr, SUM(menr.aantalkeermenu), men.menunr, men.menunaam, men.voorgerecht, men.hoofdgerecht, men.nagerecht FROM reserveringen AS res
INNER JOIN menus_regel as menr
ON res.reserveringsnr = menr.reserveringsnr
INNER JOIN menus AS men
ON menr.menunr = men.menunr
WHERE res.datum = '".$invoerdatum."'
GROUP BY menr.menunr
";
这是在我的网页上显示的:
$result = mysql_query($sql);
echo "<table>";
echo "<th>Aantal</th> <th> Menunaam </th><th> Voorgerecht </th> <th> Hoofdgerecht </th> <th> Nagerecht </th>";
while($row = mysql_fetch_assoc($result)) {
$datum = $row['datum'];
$aantalkeermenu = $row['aantalkeermenu'];
$menunr = $row['menunr'];
$menunaam = $row['menunaam'];
$voorgerecht = $row['voorgerecht'];
$hoofdgerecht = $row['hoofdgerecht'];
$nagerecht = $row['nagerecht'];
$aantalkeermenu = $row['aantalkeermenu'];
// open tr
echo "<tr id='$menunr' class='edit_tr'>";
echo "<td><span>$menunr</span></td>";
echo "<td><span>$aantalkeermenu</span></td>";
echo "<td><span>$menunaam</span></td>";
echo "<td><span>$voorgerecht</span></td>";
echo "<td><span>$hoofdgerecht</span></td>";
echo "<td><span>$nagerecht</span></td>";
echo "</tr>";
// close tr
}
echo "</table>";