Date Nightmare
Posted: Sun Oct 25, 2009 9:20 am
Hi all,
I'm having a date format nightmare.
I have a database with a timestamp.
Now all i want to do is pull up the information for the current month.
I feel like I'm going completely the wrong and difficult path.
Any help please.
x
I'm having a date format nightmare.
I have a database with a timestamp.
Now all i want to do is pull up the information for the current month.
Code: Select all
//To get the current date
$date1 = getdate(date("U"));
$date1 = $date1[month];
$details = mysql_query("SELECT
user.id AS usid,
user.username,
COUNT(comment.userid) AS userid,
date('F', comment.date) AS dates
FROM comment
WHERE dates = $date1
JOIN user ON user.id = comment.userid
GROUP BY userid
Any help please.
x