ON_SELECT auto increment, possible??

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
gotlisch
Forum Newbie
Posts: 23
Joined: Wed Jan 11, 2006 8:37 am

ON_SELECT auto increment, possible??

Post by gotlisch »

Hi Guys,

I'm looking for a way of auto incrementing an entity in a table.

What I'm trying to achieve is that when a user logs in to my system,
in other words when a specific row is selected a colum value called
"hits" or what ever is automatically incremented without have to
perform an update. Is that possible?


Cheers,


Mikael
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Not that I'm aware of. If you need to change a value in an SQL based database you'll have to run an UPDATE.
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

cant this be done by using a simple trigger????

which database software do you use?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

pedrotuga wrote:cant this be done by using a simple trigger????

which database software do you use?
There are no triggers for SELECT in MySQL, at least.
Post Reply