OK, I have put into my mySQL database a date (the date only) as a varchar of 2. So, if, say today was May 18, 2011, I store the 18 in the varchar storedDate. Now I want to retrieve that and compare it with today. Isn't working for me.
I am storing these broken out for a particular reason as I wanted to store the complete date (month day year) but other requirements is not allowing for that - might have been easier.
Here is one way I compare it after my getting the row from the master query
// this works
if ($info['storedMonth'] == date("F"))
echo 'Months match<br>';
echo 'oops, months not matching???<br>?';
// this does not
if (trim($info['storedDate']) == strtotime(date("j")))
echo 'Dates match<br>';
echo 'hmmmmm. dates not matching!!!<br>';
I also tried by removing the strtotime, trim and both. Not working.
Any help would be greatly appreciated.