PHPNewbie55 Posted July 10, 2008 Share Posted July 10, 2008 I am looking for a way to do a BETWEEN function in PHP... If you look at the advanced search page on this forum you will see a BETWEEN ___ AND ___ DAYS It is kind of like that... Let me explain... I have two numbers in my MySQL database ________________ | START | END | | 5 | 8 | | 1 | 6 | What I need to do is get any records where 4 is BETWEEN start and end... Does that make sense..?? Link to comment https://forums.phpfreaks.com/topic/114009-solved-between-in-php/ Share on other sites More sharing options...
discomatt Posted July 10, 2008 Share Posted July 10, 2008 SELECT `cols` WHERE `START` < 4 AND `END` > 4 Link to comment https://forums.phpfreaks.com/topic/114009-solved-between-in-php/#findComment-585943 Share on other sites More sharing options...
PHPNewbie55 Posted July 10, 2008 Author Share Posted July 10, 2008 LOL... For some reason I was making a much bigger deal than it was... Now that I see it.. it is so simple it hurts... Link to comment https://forums.phpfreaks.com/topic/114009-solved-between-in-php/#findComment-586025 Share on other sites More sharing options...
Barand Posted July 10, 2008 Share Posted July 10, 2008 or SELECT `cols` WHERE 4 BETWEEN `START` AND `END` Link to comment https://forums.phpfreaks.com/topic/114009-solved-between-in-php/#findComment-586145 Share on other sites More sharing options...
PHPNewbie55 Posted July 10, 2008 Author Share Posted July 10, 2008 That's even better thank you......! Link to comment https://forums.phpfreaks.com/topic/114009-solved-between-in-php/#findComment-586199 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.