Commit 5c99a06f authored by Dries's avatar Dries
Browse files

- Patch #85979 by RobRoy, keith.smith, fgm and webchick: improve documentation of db_next_id().

parent 3ec762b2
......@@ -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);
......
......@@ -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);
......
......@@ -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)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment