summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-12-27 22:13:56 +0000
committerDries Buytaert <dries@buytaert.net>2006-12-27 22:13:56 +0000
commit5c99a06f9f30b23eb587e2bc3c3e4b5dc95ac54f (patch)
tree9ff893db84d88363df569f7c9624c126c8d3c538
parent3ec762b2ab9becbedb402e72da987de288a9f29d (diff)
downloadbrdo-5c99a06f9f30b23eb587e2bc3c3e4b5dc95ac54f.tar.gz
brdo-5c99a06f9f30b23eb587e2bc3c3e4b5dc95ac54f.tar.bz2
- Patch #85979 by RobRoy, keith.smith, fgm and webchick: improve documentation of db_next_id().
-rw-r--r--includes/database.mysql.inc3
-rw-r--r--includes/database.mysqli.inc3
-rw-r--r--includes/database.pgsql.inc3
3 files changed, 9 insertions, 0 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index bdb3abb1d..aa87b5bff 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -249,6 +249,9 @@ function db_error() {
* 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.
+ *
+ * Note that the table name should be in curly brackets to preserve compatibility
+ * with table prefixes. For example, db_next_id('{node}_nid');
*/
function db_next_id($name) {
$name = db_prefix_tables($name);
diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc
index 5a1dea60f..e22e3ada4 100644
--- a/includes/database.mysqli.inc
+++ b/includes/database.mysqli.inc
@@ -234,6 +234,9 @@ function db_error() {
* 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.
+ *
+ * Note that the table name should be in curly brackets to preserve compatibility
+ * with table prefixes. For example, db_next_id('{node}_nid');
*/
function db_next_id($name) {
$name = db_prefix_tables($name);
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index fad269e05..71723d84d 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -228,6 +228,9 @@ function db_error() {
* 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.
+ *
+ * Note that the table name should be in curly brackets to preserve compatibility
+ * with table prefixes. For example, db_next_id('{node}_nid');
*/
function db_next_id($name) {
$id = db_result(db_query("SELECT nextval('%s_seq')", db_prefix_tables($name)));