i have a database where the date of entry of certain occurrence are recorded. Now when i want to retrieve it, i have a html page from where a start date and an end date is to be given, based on which, results have to be extracted from the database. Now how do i get this start date and end date, when my database has only one column for date?
Hello I just recently solved this for myself…think it is the same
first set up your two variables
[php]$todate = $_POST[’’];//add name of the input field you want to search
$fromdate = $_POST[’’];
and the select query is…
“SELECT DATE_FORMAT(col_name, ‘%d-%b-%Y’) FROM table_name WHERE col_name>=(’$fromdate’) AND col_name<= (’$todate’)”
// date format as you would like it, this is so the date is displayed in UK format
[/php]
hope this helps…there is more to add but this is the query.