12-10-2007, 01:27 AM
Hello everyone. I'm tinkering around with MySQL a little bit here and ran into snag not really with MySQL itself but it involves it. What I want to do is write a chunk of code that when a person purchases a backpack it will create a new item in the database in numerical order but when it reaches a certain number ex. 500 when the next item is created it will go back to number 1 and go back through the numbers so I don't have an excessive number title for the backpack.
example
person 1 buys 3 backpacks it will create 3 backpacks and their inventory in the database in numerical order backpack 1, 2, and 3
person 2 buys a backpack it will create backpack 4 in the database
but when it reaches backpack 500 it will restart the labeling at 1 and check to see if that number exists until it reaches 500 again. (if they are all taken it will continue at 501 until 600 or something like that)
Confused? I am 0o
PLEASE HELP :' (
example
person 1 buys 3 backpacks it will create 3 backpacks and their inventory in the database in numerical order backpack 1, 2, and 3
person 2 buys a backpack it will create backpack 4 in the database
but when it reaches backpack 500 it will restart the labeling at 1 and check to see if that number exists until it reaches 500 again. (if they are all taken it will continue at 501 until 600 or something like that)
Confused? I am 0o
PLEASE HELP :' (