0

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']; }

2nd Apr 2019, 8:50 AM
Hafiz Muhammad Ramzan
Hafiz Muhammad Ramzan - avatar
1 Answer
+ 2
(condition1 && condition2 && condition3) For example: ($count <= 10 && $bool == true && $str != "")
2nd Apr 2019, 11:19 PM
Pete Wright
Pete Wright - avatar