MySQL Forums
Forum List  »  Newbie

3 DateTime Columns in one table problem
Posted by: Keith Treuely
Date: April 29, 2005 04:07AM

I have three columns in a table

1. date_accessed
2. date_modified
3. date_created

I have 3 pages that effect these entries.

1. The input Form puts a date in all 3 columns because all those things happened when you process the form to create an entry. Obviously I only ever want the date_created column to be input once for each row of entries.

2. When someone modifies the table I want date_accessed and date_modified to be altered. This will be done by my edit form.

3. When someone only views the record I only need the date_accessed table to record the datetime. This will be done by my view form.

When they use the create item form the the SQL statement I use is like this:

$query = "INSERT INTO sometable VALUES('','$_POST[somename]', now(), now(), now())";

How do I get points 2 and 3 to happen without effecting the date_created column? How do I get point 3 to happen without affcting date_modified and date_created? Do I do it with something like the above $query? Any assistance would be greatly appreciated.

Options: ReplyQuote


Subject
Written By
Posted
3 DateTime Columns in one table problem
April 29, 2005 04:07AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.