Reply to Re: increase MySQL field value by 1? (quickly/easily)

Your name:

Reply:


Posted by Etienne Marais on 11/22/05 08:59

Gordon Burditt wrote:

>>> is there a simple (quick) way to increase the value of an integer
>>> field in a nominated row by 1 other than first having to retrieve the
>>> value and then UPDATE the appropriate field? - similar to doing a
>>> $Variable++ in PHP?
>>
>>Why not use the autoincrement feature of MySql?
>
> Autoincrement doesn't increment a field in an existing row.
> It assigns a value to a field in a *NEW* row being inserted.

Furthermore, you can use auto_increment only on (primary?) key fields.

--
Etienne Marais
Cosmic Link
South Africa

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация