diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-06-05 12:13:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-06-05 12:13:23 +0000 |
commit | 27388f66557cddce6aff1cc945601c5f843304cd (patch) | |
tree | 3a12f2afdc14b5af5be1b03d9c1fde6ac3d77928 /includes/database.mysql-common.inc | |
parent | 745222200e0670f55c6d695e467558171b7bb5d8 (diff) | |
download | brdo-27388f66557cddce6aff1cc945601c5f843304cd.tar.gz brdo-27388f66557cddce6aff1cc945601c5f843304cd.tar.bz2 |
- Patch #149176 by chx, David et al: getting rid of the sequences table, using db_last_insert_id() instead of db_next_id().
Diffstat (limited to 'includes/database.mysql-common.inc')
-rw-r--r-- | includes/database.mysql-common.inc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/database.mysql-common.inc b/includes/database.mysql-common.inc index 80f78ff36..99fde133e 100644 --- a/includes/database.mysql-common.inc +++ b/includes/database.mysql-common.inc @@ -448,6 +448,18 @@ function db_update_field(&$ret, $table, $field) { } /** + * Returns the last insert id. + * + * @param $table + * The name of the table you inserted into. + * @param $field + * The name of the autoincrement field. + */ +function db_last_insert_id($table, $field) { + return db_result(db_query('SELECT LAST_INSERT_ID()')); +} + +/** * @} End of "ingroup schemaapi". */ |