Tech Support Guy banner
Status
Not open for further replies.

ASP - incrementing numbers

1K views 2 replies 3 participants last post by  Rockn 
#1 ·
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
 
#2 ·
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?
 
#3 ·
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
Not open for further replies.
You have insufficient privileges to reply here.
Top