$servername = "localhost"; $username = "root"; $password = ""; $dbname = "pizza_shop"; $Suburb = $_POST['InputSuburb']; $Rating = $_POST['InputRating']; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT FirstName, LastName, Rating, Suburb FROM guest inner join suburb on guest.postcodefk = suburb.postcode WHERE Suburb = '$Suburb' and Rating = '$Rating'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "Name: " . $row["FirstName"]. " " . $row["LastName"]. " Suburb " . $row["Suburb"]. " Rating: " . $row["Rating"]. "<br>"; } } else { echo "0 results"; } $conn->close(); ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)