adzie Posted April 9, 2008 Share Posted April 9, 2008 hi folks, is there a way to display the next available row number in a table? Link to comment https://forums.phpfreaks.com/topic/100388-show-next-available-row/ Share on other sites More sharing options...
p2grace Posted April 9, 2008 Share Posted April 9, 2008 Can you explain further how you want to acquire it? If you want to know the next id after you've inserted one, then mysql_insert_id() + 1 will give you the next id available. If you simply want to know that next id, run a query select all ids sort by id descending and limit your results to one, then just add one to that number. Link to comment https://forums.phpfreaks.com/topic/100388-show-next-available-row/#findComment-513361 Share on other sites More sharing options...
Barand Posted April 9, 2008 Share Posted April 9, 2008 However, I cannot think why you need to know. Your application should be designed to work even if "auto_increment" created unique ids at random. Link to comment https://forums.phpfreaks.com/topic/100388-show-next-available-row/#findComment-513408 Share on other sites More sharing options...
gluck Posted April 9, 2008 Share Posted April 9, 2008 Not that I know of. Link to comment https://forums.phpfreaks.com/topic/100388-show-next-available-row/#findComment-513421 Share on other sites More sharing options...
Barand Posted April 9, 2008 Share Posted April 9, 2008 Why do I get the feeling I'm being followed? Link to comment https://forums.phpfreaks.com/topic/100388-show-next-available-row/#findComment-513424 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.