In message <[EMAIL PROTECTED]>, Wade <[EMAIL PROTECTED]> writes > >04182005 1517 GMT-6 > >Ok. Thanks for answering my question but I didnt answer my own question. >Let me ask another question then. > >I have a table that holds application data. The key is the appid. If >after viewing the app it doesnt have what Im looking for, it might be >deleted. So after a while you will have a table of applications that >doesnt have consecutive appid's.
It is quite correct, and normal, to create 'holes' in your numbering sequence. Some people try to delete the holes by shifting all the following numbers, which is usually foolish. >My question is, how do you know what the next id will be if they are not >in order? Use an index on appid if you are going to search a lot. Use SELECT appid FROM mytable ORDER BY appid; to return the rows in the order that you want them. Or perhaps you mean SELECT appid FROM mytable WHERE appid > last_id_that_I_was_looking_at ORDER BY appid LIMIT 1; But I have to admit that I can't see any situation in which you would want to know the next number, so perhaps I have misunderstood you. -- Pete Clark http://www.hotcosta.com http://www.spanishholidaybookings.com The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database possibilities through group learning. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php_mysql/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
