Re: Adding in MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



UPDATE fieldname SET fieldname=fieldname+1 WHERE where condition

Make sure to have a WHERE condition, or you will update all the 'fieldname' entries in your table - you have been warned.

PS - Didn't look very hard on mysql.com, did you ;-p
PPS - Please can you stop posting 40 empty lines to the list as your signature ? Its quite irritating.


Cheers - Neil

At 11:47 11/11/2003 +0000, you wrote:

Message-ID: <D90A32314B52D41191BF00508B6FE5630A0FA558@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
From: "Dillon, John" <JDillon@xxxxxxxxxxxx>
To: "'php-db@xxxxxxxxxxxxx'" <php-db@xxxxxxxxxxxxx>
Date: Tue, 11 Nov 2003 11:47:28 -0000
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Subject: Adding in MySQL


Can I UPDATE an int record with MySql and add 1 to it? without extracting it
into a variable first?  If so, what am I looking for in the www.mysql.com
manual.  Seems it only deals with SELECT and WHERE.

Thanks,

John

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux