PHP Mysql - How would I create a Search Query to search through Dates?

Phil M

New member
I want to create a search query that will search through dates such as SEARCH (10/30/09 to 11/30/09). How would I write a query?

EXAMPLE:
FORM- Search between Field 1 & Field 2 = Submit

??
Yeah, but can you exchange the dates for $variables? I would like the fields to turn into GET variables and such as $date1 = $_GET['date1'];
$date2 = $_GET['date2'];

then maybe

$query = "SELECT * FROM table1 WHERE username = '$username' AND contactdate BETWEEN '$date1' AND '$date2'";

something similar but this code doesn't work.
I take that back. The code above WORKS! I checked the form and I wasn't getting the username over to the next page.
 
Back
Top