You fetch the value using [man]mysql_fetch_row[/man]
Create a variable and set it's value to that ID you retrieved + 1
Then, you can use that new variable to insert into your DB for the next ID. I caution you against doing this though, without record locking/table locking, becaue you could (in theory) have 2 separate queries try to use the same number (from 2 different people) and that would screw things up (if you want to maintain uniqueness.)
Why not let the auto_increment feature do exactly what it was designed to do?