I have a page that receives form data from a submitted form, I wrote a SELECT statement to search my database when the page is loaded (from the form submit) and the POST form variables are created. The problem I'm having is the query returns 0 Results using the $aircraftMake variable but when I enter a static value in place of the variable I get the desired results. I am fairly new to all this so any help would be appreciated. I have listed the code below.
<?php
$aircraftMake = mysqli_real_escape_string($conn, $_POST['marke']);
$aircraftModel = mysqli_real_escape_string($conn, $_POST['model']);
$engine = mysqli_real_escape_string($conn, $_POST['Motorisation']);
?>
</head>
<body>
<?php
$sql = "SELECT * FROM QuoteData WHERE aircraftMake = '$aircraftMake'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo $row["aircraftMake"]. "<br>" . $row["aircraftModel"]. "<br>" . $row["engineModel"]. "<br>" . $row["overhauledEngineSteelCylinders"]. "<br>" . $row["overhauledEngineNickelCylinders"]. "<br>" . $row["overhauledEngineNewCylinders"]. "<br>" . $row["individualOverhauledSteelCylinder"]. "<br>" . $row["setOfFourOverhauledSteelCylinders"]. "<br>" . $row["individualOverhauledNickelCylinder"]. "<br>" . $row["setOfFourOverhauledNickelCylinders"]. "<br>" . $row["engineCoreValue"]. "<br>" . $row["note1"]. "<br>" . $row["note2"]. "<br>" . $row["note3"]. "<br>" . $row["OverhaulIncludes"]. "<br>" . "<br>" . $row["shippingToInclude"];
}
} else {
echo "0 results";
}
$conn->close();
?>