I am trying to create an order tracking system and has the following query
//create the order variable and assign it the value that the user has entered
$order = $_POST["order"];
$query = mysqli_query($link,"SELECT shipping_status FROM orders WHERE code_ticket = $order");
if($result = mysqli_fetch_assoc($query)){
//the status value
$status = $result['shipping_status'];
}
else{
$status = "Order Not yet placed";
}
My problem is that the query is that I am getting the else part executed and not the if part even when I supply a value that is in the db. What could I be doing wrong?