hi
i have a table where dates and other info are getting inserted...
i have a form where the user can select a start date end date..
based on the start date and end date ..i want to retrieve all the content stored between these dates.....
kings
-7
Junior Poster
Recommended Answers
Jump to Post$sql="select * from table where (start_date between '$start_date' and '$end_date') or (end_date between '$start_date' and '$end_date')";
considering start_date and end_date are the columns of your table, the first condition will fetch the records if the start_date lies between the range of $start_date and $end_date (the user's input). …
Jump to Posthow does the admin enter the dates? does he have a form ? what is the name of those text fields ? basically, this will work.
$sql="select * from table where date between '$start_date' and '$end_date'";
$start_date and $end_date are post variables of the form.
All 7 Replies
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
kings
-7
Junior Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
kings
-7
Junior Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
kings
-7
Junior Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.