PEAR DB: How do I set the value of a sequence?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Using the PEAR DB abstraction layer, I can create a sequence like this:


Then I can get the next ID of that sequence like this:

$id = $db->nextId('mySequence');

But how do I initialize the sequence to have the appropriate starting value
based on the table I'm using it as a unique key for?  For example, I have a
users table that has a unique user_id column.  How do I make it so that the
sequence picks up where the user_id column in the table leaves off?


Chris Finke

Site Timeline