DB_common::limitQuery() (Previous) (Next) DB_common::nextQueryIsManip()

View this page in Last updated: Sun, 01 Jul 2007
English | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Plain HTML

DB_common::nextId()

DB_common::nextId() -- Returns the next number from a sequence

Descripción

Returns the next available number from a sequence. The sequence is automatically incremented each time this method is called.

See "Intro - Sequences" for a more complete discusion.

Parámetro

string $seq_name

name of the sequence

To avoid problems with various database systems, sequence names should start with a letter and only contain letters, numbers and the underscore character.

boolean $onDemand

When TRUE, the sequence is automatically created if it does not exist yet.

The on demand creation process necessitates the database user specified in the script having the database permissions needed to create a table or sequence. The exact privileges involved depends on the DBMS being used.

Valor devuelto

integer - a free id number or a DB_Error object on failure

Nota

Esta función no puede ser llamada estáticamente.

Aviso

When using PEAR DB's sequence methods, we strongly advise using these methods for all procedures, including the creation of the sequences. Do not use PEAR DB's methods to access sequences that were created directly in the DBMS. See the warning on the "Intro - Sequences" page complete information.

DB_common::limitQuery() (Previous) (Next) DB_common::nextQueryIsManip()

Download Documentation Last updated: Sun, 01 Jul 2007
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.