cyprus Posted September 23, 2006 Share Posted September 23, 2006 I have a series of checkboxes on a page/form which allows the user to dynamically build a WHERE statement.$where = "WHERE GGroup IN ('$prodlist')";Is it possible to add into the above a where condition to select records between two dates? Many thanks. Quote Link to comment Share on other sites More sharing options...
onlyican Posted September 23, 2006 Share Posted September 23, 2006 something like[code]<?php$from_date = "2006-01-01";$to_date = "2006-09-24";$query = "SELECT * FROM table WHERE date_added BETWEEN '".$from_date."' AND ".$to_date."'";?>[/code] Quote Link to comment Share on other sites More sharing options...
cyprus Posted September 24, 2006 Author Share Posted September 24, 2006 Many thanks, that sorted it. Regards Quote Link to comment 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.