Re: PEAR DB Sequences

From: Date: Fri, 18 Oct 2002 20:35:11 +0000
Subject: Re: PEAR DB Sequences
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2526@lists.php.net to get a copy of this message
I think you make perfect sense. So when I create the table I just set the id field as an unsigned int and define it as the primary key, but make no reference to incrementation or sequences. I then setup the sequence via the PEAR DB Sequence operation, one sequence for each table that needs one? Please correct me if I'm mistaken. That is VERY nice. Thanks! Don. On Fri, 18 Oct 2002, Arnaud Limbourg wrote: > Hello, > > When you first use a sequence PEAR::DB creates it in the DB, so you don't *have* to create > it beforehand, you can though, in which case it has to be of the form 'sequencename_seq' > without the quotes and if you left the default values. You can change the format of the string used > to create the sequence to match your own preferences. > > If you create it you must not set it to autoincrement but better to INT unsigned. > > If I'm not clear do not hesitate to ask again ;) > > Arnaud. > > > I'm a bit confused by sequences. Does the name you use for a sequence > > need to be that of a sequence you've created on the database? My concern > > is I don't know of a way to explicitly create a sequence in mysql. > > > > Also I'm assuming that if I use PEAR DB I shouldn't specify > > "auto_increment" in my create table syntax. > > > > Don. >

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