rex9990 Posted February 22, 2008 Share Posted February 22, 2008 Is there a way to do a greater then but less then function? As in: [greater then] $Minprice [but less then] $Maxprice I've had a look over google and im not getting anything about it. Thanks Steve Quote Link to comment https://forums.phpfreaks.com/topic/92426-can-you/ Share on other sites More sharing options...
Orio Posted February 22, 2008 Share Posted February 22, 2008 What do you exactly need? To check if something is between two values? To get a random value in between two values? You have to sharpen your question a bit... Orio. Quote Link to comment https://forums.phpfreaks.com/topic/92426-can-you/#findComment-473552 Share on other sites More sharing options...
harristweed Posted February 22, 2008 Share Posted February 22, 2008 I think you mean something like this: <?php function between($price){ $Maxprice = 200 ;// set maximum $Minprice = 100 ;// set minimum if($price <= $Maxprice && $price >= $Minprice){ echo" In range "; }else{ echo" Out side Limit "; } } between(150) ; between(500) ; ?> Quote Link to comment https://forums.phpfreaks.com/topic/92426-can-you/#findComment-473555 Share on other sites More sharing options...
rex9990 Posted February 22, 2008 Author Share Posted February 22, 2008 Sorry, ill reword it: What i have is a search page that has a max and min prices which both have 2 different rows in the databases. In the search box the options are 10, 25, 50, 75 ... and im looking to check them numbers with the ones entered in the database and return all the results between the two given numbers. Quote Link to comment https://forums.phpfreaks.com/topic/92426-can-you/#findComment-473557 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.