t_machine Posted April 25, 2006 Share Posted April 25, 2006 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 :) Quote Link to comment Share on other sites More sharing options...
Barand Posted April 25, 2006 Share Posted April 25, 2006 [code].... WHERE DATE_FORMAT(FROM_UNIXTIME(date_added), '%m,%Y') = '$thismonth'[/code] Quote Link to comment Share on other sites More sharing options...
t_machine Posted April 26, 2006 Author Share Posted April 26, 2006 Thank you very much :) This works great! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.