Page 1 of 1

Date Stamp

Posted: Tue Dec 09, 2008 8:39 am
by Yanayaya
I have a PHP CMS that I made for the submission of news articles to a mysql database. What I would like to do is include the date the article was created. I was trying to use DATE_STAMP in my sql but it was retunring 0000-00-00 on every entry.

Is there a way I can have php grab the date and save it along with the article and include it in the displayed articles after submission is complete? :banghead:

Re: Date Stamp

Posted: Tue Dec 09, 2008 8:43 am
by papa
You can use the timestamp function in mysql and then retrieve it to be displayed. Otherwise date() is your friend.

Re: Date Stamp

Posted: Tue Dec 09, 2008 8:43 am
by aceconcepts
You can use DATE as the data type in the DB and date("Y-m-d") in PHP.

Re: Date Stamp

Posted: Tue Dec 09, 2008 9:14 am
by Yanayaya
Ahh, job done, cheers fella's :mrgreen: :drunk: