$dbQuery=$conn->prepare("select * from Food where Keyword = '$1'");
Not a solution to your question, but another problem you have.
Never build an SQL query by concatenating strings. Sooner or later, you will do it with user inputs, and this opens door to a vulnerability named "SQL injection", it is dangerous for your database and error prone.
A single quote in a name and your program crash. If a user input a name like "Brian O'Conner" can crash your app, it is an SQL injection vulnerability, and the crash is the least of the problems, a malicious user input and it is promoted to SQL commands with all credentials.
SQL injection - Wikipedia[
^]
SQL Injection[
^]
SQL Injection Attacks by Example[
^]
PHP: SQL Injection - Manual[
^]
SQL Injection Prevention Cheat Sheet - OWASP[
^]
-----
Advice: Learn to indent properly your code. It help reading by showing the structure.
<?php
$1 = ("cheese");
$2 = ("yoghurt");
$3 = ("egg");
$dbQuery=$conn->prepare("select * from Results");
$dbQuery=$conn->prepare("select * from Food where Keyword = '$1'");
$dbQuery->execute();
echo $dbQuery->rowCount()."\n";
while ($dbRow=$dbQuery->fetch(PDO::FETCH_ASSOC)) {
if ($1 = '1') {
echo "<br><br>".$dbRow["Name"]."<br>"."<br><img src=/".$dbRow['Picture']."' width='150' height='150' float='left'/>"."".$dbRow["Instructions"]."\n";
} else {
echo "";
}
$dbQuery=$conn->prepare("select * from Food where Keyword = '$2'");
$dbQuery->execute();
if ($2 = '1') {
echo "<br><br>".$dbRow["Name"]."<br>"."<br><img src=/".$dbRow['Picture']."' width='150' height='150' float='left'/>"."".$dbRow["Instructions"]."\n";
} else {
echo "";
}
$dbQuery=$conn->prepare("select * from Food where Keyword = '$3'");
$dbQuery->execute();
if ($3 = '1') {
echo "<br><br>".$dbRow["Name"]."<br>"."<br><img src=/".$dbRow['Picture']."' width='150' height='150' float='left'/>"."".$dbRow["Instructions"]."\n ";
} else {
echo "";
}
}
?>
Professional editors have this feature along with others, like parenthesis matching, that are helpful to programmers.
Notepad++ Home[
^]
-----
Nota: your code is really weird, you should explain what it is supposed to do.