I have Two tables, Tour table and Tour Dates table.
- tours Table
- Id
- tour_title
Here's a link of table to view tour table!
- tour_dates Table
- id
- tour_id
- price
Here's a link of table to view tour_date table!
Now I am using filter of price range like
- From $10 to $50
- From $50 to $80
- From $80 to $100
I have tried lots of different queries of join and even tried for nested query like this one.
$qry = "SELECT * FROM `tours` WHERE status='1' ";
$qry1 = mysqli_query($con,$qry);
while($data = mysqli_fetch_array($qry1)){
$qfilter = "SELECT * FROM `tour_dates` WHERE tour_id='".$data['id']."' AND (`price` BETWEEN 10 AND 50) ORDER BY price DESC ";
$qfilter1 = mysqli_query($con,$qfilter);
$tour_ob = mysqli_fetch_object($qfilter1);
$num = mysqli_num_rows($qfilter1);
if($num>0){
------
}
}
Please provide any solution. thank you.