How to use three conditions with AND operator in while loop in PHP
$query = "select * from agent_profile where status=1"; $run = mysqli_query($con,$query); $getid = mysqli_fetch_array($run); $crntid = $getid['agent_id']; $pricequery = "select * from airport_parking where airport_name = '$airport' AND '$parking_start_time' >= start_time "; $resultprice = mysqli_query($con,$pricequery); $squery = "select * from agent_services where service_type= '$service_type' "; $srun = mysqli_query($con,$squery); if( $run AND $resultprice AND $srun ){ while (($datarow = mysqli_fetch_array($run)) && ($getdata = mysqli_fetch_array($resultprice)) && ($sdata = mysqli_fetch_array($srun))) { $crnt_id = $datarow['agent_id']; $price = $getdata['price_day']; $adddayprice = $getdata['add_day_price']; }