Hi all- I'm having some trouble with mysql timestamps. I'm trying to sort between 2 dates:
A user selects a month and a year for the start date and a month and a year for the end date. (example: 01/2003 to 10/2003) The page will then return a list of entries that were timestamped between those 2 dates.
The timestamp is timestamp(14) in the mysql db. An example timestamp is: 20031213155111. The month can be passed either as the full name (January, February, etc.) or as a number (01, 02, etc....they may still be treated as characters rather than integers by PHP, I'm not sure). I'm guessing the latter would be better. Both month and year are passed in input fields:
<select name="startmonth"> (or <select name="endmonth"> )
<? while ($monthlist = mysql_fetch_array($query_monthlist)) { ?>
<option value="<?=$monthlist[monthid]?>"><?=$monthlist[monthid]?>
<? } ?>
</select>
<select name="startyear"> (or <select name="endyear"> )
<option value="2003">2003
</select>
What I need is the SQL statement that will use the timestamp(14) field (paydate) to pull all entries between the 2 entered dates.
Thanks...