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

Your name:

Reply:


Posted by Rik on 11/22/05 13:12

Stefan Rybacki wrote:
> rob@centralpoint.nl wrote:
>> Sure, increase it in the update query, example:
>> UPDATE hit SET counter+1 WHERE site='www.google.com'
>> (assuming that counter field is integer)
>
> Well, should be:
> UPDATE hit SET counter=counter+1 WHERE site='www.google.com'
>


Hmmz would this work?

UPDATE hit SET counter=counter+1 WHERE counter > 5

I have no way to test this quickly right now, but it would save a lot of
lines of code :-)
It's for a table displayed in a specific order, and order has te be
changeable.

Grtz,

Rik

[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

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