I have an sql query which has several fields and no matter how hard i try i cant get the less than statement to work....i originally tried between but that wouldnt work either.
$yourpricesearc h is the name of the drop box with in the search form with the price values of 5.00, 10.00, 15.00 etc...i did it this way as i wasn't sure if when i put the AND in when the value of $yourpricesearc h was empty would cause problems so im only putting the statement in if $yourpricesearc h has a value
my prices of the books are in the format 10.15 for example
it still doesnt even seem to work if i put the less than statement directly into the sql query......also between statement didnt work.
im not sure if something is wrong in the statement?
sorry forgot to say how it returns wrong results.....at the momwent there are book prices ranging from 2.00 to 19.00 ish.....when you search for less than 20.00...they all show.....less than 15.00 they all show.....less than 10.00....none show...yet there are some with 5.00.....2.00 etc?
thanks
$yourpricesearc h is the name of the drop box with in the search form with the price values of 5.00, 10.00, 15.00 etc...i did it this way as i wasn't sure if when i put the AND in when the value of $yourpricesearc h was empty would cause problems so im only putting the statement in if $yourpricesearc h has a value
my prices of the books are in the format 10.15 for example
Code:
if(!$yourpricesearch==""){$yourprice=" AND yourprice < '$yourpricesearch'";} //Now we search for our search term, in the field the user specified $sql = "SELECT * FROM mytable_name WHERE status = 'active' AND isbn LIKE '%$isbnsearch%' AND title LIKE '%$keyword%' AND topic LIKE '%$topicsearch%' AND university LIKE '%$universitysearch%' $yourprice";
im not sure if something is wrong in the statement?
sorry forgot to say how it returns wrong results.....at the momwent there are book prices ranging from 2.00 to 19.00 ish.....when you search for less than 20.00...they all show.....less than 15.00 they all show.....less than 10.00....none show...yet there are some with 5.00.....2.00 etc?
thanks
Comment