gerkintrigg Posted March 22, 2007 Share Posted March 22, 2007 I'm using this code: $avail_query="SELECT COUNT(*) as records FROM booking WHERE (start_date BETWEEN $week_start2 && $week_end2) || (end_date BETWEEN $week_start2 && $week_end2) || ($week_start2 BETWEEN start_date && end_date) || ($week_end2 BETWEEN start_date && end_date)"; to try to count SQL records, but it's not working. It's returning 0 rows, which is weird because it should be returning 3. however, I replaced the variables with values and tried it in PHPMyAdmin and there are no rows returned again. Please help. Thanks, Neil Link to comment https://forums.phpfreaks.com/topic/43825-solved-sql-between-problem/ Share on other sites More sharing options...
gerkintrigg Posted March 22, 2007 Author Share Posted March 22, 2007 Sorry... sorted it now... I forgot the " ' " thingies. mad that it's been bugging me for days though. Thanks! Link to comment https://forums.phpfreaks.com/topic/43825-solved-sql-between-problem/#findComment-212749 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.