php - My SELECT statement is not working correctly with form submitted variables -


i have page receives form data submitted form, wrote select statement search database when page loaded (from form submit) , post form variables created. problem i'm having query returns 0 results using $aircraftmake variable when enter static value in place of variable desired results. new appreciated. have listed 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 * quotedata 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(); ?> 

code looks ok, sure $_post data set?

<?php   if(isset($aircraftmodel)){      // code here   } 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -