Getting back into scripting..Newbie question.

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
Random
Forum Commoner
Posts: 30
Joined: Wed Mar 12, 2003 5:38 pm

Getting back into scripting..Newbie question.

Post by Random »

I was wondering how to get a value from the database/table..and then adding the new amount to it. I am setting up an online store, and would like to get my profit from before, and add in the new profit automatically, then print it on a site when I log on. I want to know how to call the profit beforehand..I can do the rest. Thanks.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Would an UPDATE statement be appropriate?

Code: Select all

UPDATE tablename SET field = field + whatever WHERE field_id = current_field_id
Mac
Post Reply