Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
gotlisch
Forum Newbie
Posts: 23 Joined: Wed Jan 11, 2006 8:37 am
Post
by gotlisch » Sat Oct 21, 2006 10:02 am
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
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Sat Oct 21, 2006 11:25 am
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.
pedrotuga
Forum Contributor
Posts: 249 Joined: Tue Dec 13, 2005 11:08 pm
Post
by pedrotuga » Sat Oct 21, 2006 11:38 am
cant this be done by using a simple trigger????
which database software do you use?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Oct 21, 2006 3:06 pm
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.