How do i add to an interger through sql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
HomerTheDragoon
Forum Newbie
Posts: 21
Joined: Sat Jul 08, 2006 2:10 am

How do i add to an interger through sql

Post by HomerTheDragoon »

Alright i cant figure this out for some reason..

I have an interger stored in my sql db, and i want to add lets say, 4 to it. How do i do this? I can update strings, but i cant get it to update intergers.

Edit: nvm, there was a mistake in my code :P
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

FYI:

Code: Select all

UPDATE `table` SET `column` = `column` + 4 WHERE `blah` = 'foo';
HomerTheDragoon
Forum Newbie
Posts: 21
Joined: Sat Jul 08, 2006 2:10 am

Post by HomerTheDragoon »

yah i was doing that, but i wasnt acutally getting the info from the db:P i left it out some how.
Post Reply