ASP - incrementing numbers

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Seema25

Thread Starter
Joined
Dec 18, 2001
Messages
3
hi,

I got a question to be solved. Does anyone know how to write the code to increment the product number and pass it on to the next page, to be added to the database, so the user doesn't have to type it in? Basically, i want to take the last product number from the product page, increment it to the next number (the product number or any id's has to be hidden on the product page), so if the last number in the db is 0012 i want the next number to be 0013, pass it to the addprod page and show it on the form and then have it stored in the db with that particular product - so every product has a unique product number.


any help would be great

seema
 

Spu

Joined
Nov 25, 2001
Messages
71
I don't know if i understand your question (sorry for being stupid). The way i see it is that you want to let your users to add products (insert records) to your database with unique ID numbers, is this right?

If it is, its a simple operation, especially if your using MM Ultradev.

What are you writing the script in, ASP, Coldfusion, PHP, etc.? And what database are you using, Access, SQL?
 
Joined
Jul 29, 2001
Messages
21,334
If you are writing to an Access db your table should already be set up to have a primary key that will increment every time a new record is added. If it's SQL just do a query that looks for the max and then add 1 to it in the appropriate field.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top