i am designing a website in which i need to generate an offset value for a product(and store it in database) between 1 to 999 for every product id i store into my database from a textbox..but first it must check if a particular value starting from 1 to 999 is already taken if yes then it generates the next available number between 1 to 999..the problem is how can i retrieve and check the available numbers already stored in offset column of my database and then generate next available number?
for example: if 1 ,2 ,3 ,6,8 numbers are taken offset value generated should be 4 and not 7..
though its difficult to explain but if u understand my question i wuld be glad to have some code of how to achieve it??
for example: if 1 ,2 ,3 ,6,8 numbers are taken offset value generated should be 4 and not 7..
though its difficult to explain but if u understand my question i wuld be glad to have some code of how to achieve it??
Comment