<?php
include("login.php");
$befehl = "SELECT * FROM produkte WHERE produkte.kategorie = BeliebteGerichte";
foreach($pdo->query($befehl) as $row)
{
echo "
<div class=angI>
<div class=angF>
<div id=t1>".$row['gericht']."</div>
<div id=t2>".$row['erl']."</div>
<div id=t3>".$row['wahl']."</div>
<div id=t4>".$row['preis']."€</div>
</div>
</div>
";
}
?>
My goal is to only display the dishes that have the text "BeliebteGerichte" in their kategorie column from my database. Maybe I made an obvious mistake but I have no idea about PHP.
Here is the error message I got:
Fatal error : Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'BeliebteGerichte' in 'where clause' in /users/christian313438/www/greeky/index.php:42 Stack trace: #0 /users/christian313438/www/greeky/index.php(42): PDO->query('SELECT * FROM p...') #1 {main} thrown in /users/christian313438/www/greeky/index.php on line 42