| | |
decrementing values in data base
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2005
Posts: 2
Reputation:
Solved Threads: 1
•
•
•
•
Originally Posted by jody
Hi I want to know how i can decrement the value of quantity in stock in my data base. This would be based on how times an item is purchased.
So every time an item is clicked, i want to show the quantity has decreased in the database.
Pls help.
Well, when the hyperlink is clicked, whatever page the hyperlink goes to should contain something like this:
1. a connection string to your data base.
2. an SQL statement:
UPDATE [your table's name] SET [in-stock quantity fieldname] = ([in-stock quantity fieldname] - 1) WHERE [unique key fieldname] = [unique key value].
So... if your table was named "products" let's do an example:
UPDATE products SET InStockQty = (InStockQty - 1) WHERE productID = 3
get it?
![]() |
Similar Threads
- can't binding an autoincrement field of mysql data base from vb.net (VB.NET)
- Address Book Data Base (C++)
- conversion of text file into data base file (Visual Basic 4 / 5 / 6)
- Program Problem with a select statement to access Data base (C)
- Need to make program access a data base primary key number entered by user (C)
- data access (Visual Basic 4 / 5 / 6)
Other Threads in the ASP Forum
- Previous Thread: Depending upon the option selected in a combo box, how to perform the corresponding a
- Next Thread: mysqldump from asp
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit web webserver windows7





