Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
cturner
Forum Contributor
Posts: 153 Joined: Sun Jul 16, 2006 3:03 am
Location: My computer
Post
by cturner » Fri Nov 03, 2006 4:53 pm
Can someone please tell me how I can increase the quantity and put the quantity in a database table? Thanks in advance.
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Fri Nov 03, 2006 4:57 pm
you need to be a little more specific than that please.
cturner
Forum Contributor
Posts: 153 Joined: Sun Jul 16, 2006 3:03 am
Location: My computer
Post
by cturner » Fri Nov 03, 2006 5:27 pm
I am creating a shopping cart and when a user clicks on the order button and if the product is already in the database table I want to increase the quantity.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Nov 03, 2006 5:30 pm
You'll need some form of an UPDATE query.
cturner
Forum Contributor
Posts: 153 Joined: Sun Jul 16, 2006 3:03 am
Location: My computer
Post
by cturner » Fri Nov 03, 2006 5:35 pm
Yes I understand that I need to use the update query but how do I increase the quantity?
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Fri Nov 03, 2006 5:36 pm
Code: Select all
UPDATE `sometable` SET `somefield` = `somefield` + 1