function db_next_id in Drupal 4
Same name in this branch
- 4 includes/database.mysqli.inc \db_next_id()
- 4 includes/database.mysql.inc \db_next_id()
- 4 includes/database.pgsql.inc \db_next_id()
Same name and namespace in other branches
- 8 core/includes/database.inc \db_next_id()
- 5 includes/database.mysqli.inc \db_next_id()
- 5 includes/database.mysql.inc \db_next_id()
- 5 includes/database.pgsql.inc \db_next_id()
- 7 includes/database/database.inc \db_next_id()
Return a new unique ID in the given sequence.
For compatibility reasons, Drupal does not use auto-numbered fields in its database tables. Instead, this function is used to return a new unique ID of the type requested. If necessary, a new sequence with the given name will be created.
Related topics
15 calls to db_next_id()
- aggregator_save_category in modules/
aggregator.module - Add/edit/delete aggregator categories.
- aggregator_save_feed in modules/
aggregator.module - Add/edit/delete an aggregator feed.
- aggregator_save_item in modules/
aggregator.module - comment_save in modules/
comment.module - Accepts a submission of new or changed comment content.
- drupal_client_ping in modules/
drupal.module - Callback function from drupal_xmlrpc() called when another site pings this one.
File
- includes/
database.pgsql.inc, line 199 - Database interface code for PostgreSQL database servers.
Code
function db_next_id($name) {
$id = db_result(db_query("SELECT nextval('%s_seq')", db_prefix_tables($name)));
return $id;
}