Re: Update timestamp with a select

"Jan Theodore Galkowski" <[email protected]>
Newsgroups gmane.comp.db.mysql.windows
Message-ID <[email protected]>
Paulo,

In general, the way it works is by having a first TIMESTAMP column which
can be NULL and have NULL as their default value, and arranging to
update that row with a NULL or simply in place and having the default
NULL trigger the update.  Beginning with 4.1 there are other options:

  http://dev.mysql.com/doc/refman/5.0/en/timestamp-4-1.html

Given a version of MySQL sufficiently advanced (5+) you can use triggers
to do this automatically.

There's a drill showing how this works at:

  http://www.huggle.com/forums/viewtopic.php?t=38&sid=c7f96ce4daf69c90c50a451b51067a40


- Jan


On Sat, 1 Apr 2006 14:24:57 -0600 , "Urcid Pliego, Paulo"
<[email protected]> said:
> Hi, does anyone know if it's possible for a timestamp column to
> automatically update itself when a select is made? We have a
> user/password/roles database that is accessed by Tomcat's j_security
> module whenever a user logs into one of our webapps, and I want to
> know which users haven't logged in recently so that I can erase their
> accounts. I would appreciate all of your feedback on this one.
>
> Thanks!
>

[snip]
-- 
Jan Theodore Galkowski   (o°)                    
 [email protected]
 http://www.smalltalkidiom.net



-- 
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.