bool createSequence( optional string $sequenceName='adodbseq', optional int $startNumber )
The function createSequence()
creates an auto-incrementing number device. If the database supports it, it uses native sequence handling routines, otherwise it emulates the functionality using a table and an auto-incrementing numbers.
Once created, numbers can retrieved using genId().
/* * Connection assumed */ /* * Create a sequence called my_sequence, using default start of 1 */ $db->createSequence('my_sequence');