Problem: You want to know the next id for the nodes. According to drupal you should use db_last_insert('table', 'field'). It returned allways zero for me.
What is the solution to overcome this problem? use SHOW TABLE STATUS WHERE Name='node' in the returned object you 'll find the next value for the autoincrement.