Jump to content

How to compare dates in mysql query


t_machine

Recommended Posts


hi, I am wondering if anyone can help me with this date problem. I have a database that stores username and date(unix timestamp). I would however like to list all the usernames within the current month. Something like this would be great.

$thismonth = date('m,Y', time()); // 04,2006
"SELECT username FROM TABLENAME WHERE date_added ='$thismonth'

how can i strip the 'date_added' which is in timestamp to month and year so I could compare and list the users within that month. Thanks :)
Link to comment
https://forums.phpfreaks.com/topic/8392-how-to-compare-dates-in-mysql-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.