Skip to content

Instantly share code, notes, and snippets.

Created July 27, 2013 20:23
Show Gist options
  • Save anonymous/6096170 to your computer and use it in GitHub Desktop.
Save anonymous/6096170 to your computer and use it in GitHub Desktop.
$conn = mysqli_connect($host,$user,$pass,$database);
$result = mysqli_query($conn, "SELECT * FROM student_food WHERE (Ingredients LIKE '%$text1%') && (Ingredients LIKE '%$text2%') && (Ingredients LIKE '%$text3%') ");
echo "<table border='1'>";
echo "<th>Ref</th><th>Image</th><th>Name</th><th>Description</th>\n";
while ($b = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $b["Ref"] . "</td>";
echo "<td>" . $b["Image"] . "</td>";
$anchorString = "<a href='item.php?id={$b['Name']}'>{$b['Name']}</a>";
echo "<td>" . $anchorString . "</td>";
echo "<td>" . $b["Description"] . "</td>";
echo "</tr>";
}
echo "</table>\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment