Jump to content

Automatically inserting time/date into database?


aaricwon

Recommended Posts

======|RowID|Subject|SStory|FStory|DatePosted=========

 

===============================================

 

RowID = Primary, Auto_increment

DatePosted = TYPE:timestamp

 

I think this is the very easiest way to insert automatically the current time and date after you have posted. But there are so many ways.. ;)

 

Regards

Link to comment
Share on other sites

You know, I don't know whats up but my TIMESTAMP to current_timestamp never works. My INSERT stops working so I had to do a format in PHP to get inserted into an INT. Maybe I'm just doing it wrong. Do I put anything in the INSERT or put a NULL or NOW() or don't even put a value for the TIMESTAMP. None of them work for me

Link to comment
Share on other sites

hi, no need to put a value for a timestamp in the structure of your table. ex. namefield simply use timestamp. so in your php page no need to insert date to save because automatically the current time and date of your system save in your dbase after you have inserted some data's. but make sure try to create field for your primary key. ex rowid TYPE int, auto_increment.

 

========= |rowid| name | date_posted | ==========

                  001    John  00,00,00 00:00:00

                  002    Allan  00,00,00 00:00:00

==========================================

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.