Unix Technical Forum

Keeping count

This is a discussion on Keeping count within the MySQL forums, part of the Database Server Software category; --> Hi, I am trying to keep count of an item. Table: id | item | count I want to ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:52 AM
kev
 
Posts: n/a
Default Keeping count

Hi,

I am trying to keep count of an item.

Table: id | item | count

I want to increment count by 1 when item is accessed using one SQL
statement. Is this possible?

Thank you in advance for your help.

Kev

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:53 AM
Gordon Burditt
 
Posts: n/a
Default Re: Keeping count

>I am trying to keep count of an item.
>
>Table: id | item | count
>
>I want to increment count by 1 when item is accessed using one SQL
>statement. Is this possible?


UPDATE tablefoo set count = count + 1 where id = 666;

Gordon L. Burditt
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:18 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com