selecting all from database where string contains price...
Posted: Mon Feb 01, 2010 9:42 am
I want to display results based on price being high to low or vice versa...
The string in the database field is always going to be something alog the lines of..."2 night price from £675 per person in a Superior River Wing Room. Flights and tranfsers available on request."!
I want to match the £price section of the string and return results between a given starting and ending number.
The above is one of my failed attempts.
Any ideas on what I need to do here?
Thank You
N.B.
If the price field holds only numbers such as 345 etc. the script works when using the following statement fine...
The string in the database field is always going to be something alog the lines of..."2 night price from £675 per person in a Superior River Wing Room. Flights and tranfsers available on request."!
I want to match the £price section of the string and return results between a given starting and ending number.
Code: Select all
$query=" SELECT * FROM admin_holiday_destinations WHERE holiday_country = '".$show."' AND holiday_type = '".$holType."' AND price LIKE %£_% BETWEEN ".$startNo." AND ".$endNo." ORDER BY $order LIMIT $eu, $limit ";
$result=mysqli_query($mysqli, $query);
Any ideas on what I need to do here?
Thank You
N.B.
If the price field holds only numbers such as 345 etc. the script works when using the following statement fine...
Code: Select all
$query=" SELECT * FROM admin_holiday_destinations WHERE holiday_country = '".$show."' AND holiday_type = '".$holType."' AND price BETWEEN ".$startNo." AND ".$endNo." ORDER BY $order LIMIT $eu, $limit ";
$result=mysqli_query($mysqli, $query);