[GLLUG] PHP/MySQL Dev question (again)
Sean
picasso@madflower.com
Sat, 16 Nov 2002 18:58:36 -0500 (EST)
Use the system time for your original time field, let the db keep track of
the modification times. And really you should be using an auto-increment
field for your unique id field.
You would do somthing like:
if (!isset($original_time)) {
$original_time = date("YmdHI") ;
}
Or something like that (untested)
Sean
On Sat, 16 Nov 2002, Mike Szumlinski wrote:
> Okay, here is what I'm tryin' to do...probably simple...
>
> I have a table that users update that has a timestamp (dateadded)
> within it. That used to suffice when the users could only ADD items,
> but now that they can modify as well, every time the item is modified
> the timestamp grabs the new time. Since my list is ordered by date,
> this throws things off...so I need to figure out a way to add a
> modified date (which would be the timestamp) to the table as well as
> the dateadded field (which is not null and is unchangeable).
>
> I was using the dateadded timestamp as a unique ID (probably not the
> greatest idea, but since I don't think 2 people will post at the exact
> same time down to the second on the site, I'm not that worried). But
> now that the dateadded timestamp changes when the data in the table is
> modified, it just screws everything up. Any ideas on how to do this
> would be much appreciated.
>
> -Mike
>
>
> _______________________________________________
> linux-user mailing list
> linux-user@egr.msu.edu
> http://www.egr.msu.edu/mailman/listinfo/linux-user
>