Re: problems with nextId

From: Date: Fri, 16 Aug 2002 18:36:04 +0000
Subject: Re: problems with nextId
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2141@lists.php.net to get a copy of this message
On Fri, Aug 16, 2002 at 07:56:08PM +0200, Markus Wolff <wolff@21st.de> wrote: > On Fri, 16 Aug 2002 12:10:13 -0500 > "Matt McDonald" <matt@coffeecup.com> wrote: > > > I'm still kind of confused how sequences work. Right now, I've got 22 > > tables set up in by database. So when I call nextId to set up a new > > sequence, does it scan all tables and come up with a value that would work > > no matter what table I insert into? If that is the case, perhaps there is a > > table I have configured that stumps the scanning process? > > No tables are scanned. It´s really not that complicated. If you call > > $newId = $db->nextId("mySequence"); > > ....PEAR::DB looks if a Sequence called "mySequence" exists. If yes, it > will get a new value from the sequence. If the sequence doesn´t exist, > PEAR::DB will try to create a new one called "mySequence", which will > start with the value 1. Perhaps his error is caused by the user he is connected as not having permission to add a table to the database? -- Bob Bell <bobbell@zk3.dec.com> ------------------------------------------------------------------------- "The Ferraris are only gravy, honest!" -- John Carmack, Doom and Quake developer

« previous php.pear.general (#2141) next »