Re: auto increment

From: Date: Fri, 06 Dec 2002 11:13:30 +0000
Subject: Re: auto increment
References: 1 2 3  Groups: php.windows 
Request: Send a blank email to php-windows+get-17311@lists.php.net to get a copy of this message
Thanks to all who replied to my problem. Much appreciated... Pat J. "Cam Dunstan" <cam@norex.com.au> wrote in message news:004001c29c63$23c7fec0$7866a8c0@camhome... > another gotcha with auto increment fields - you can`t combine contents of > two tables, each with their own auto incrementing fields which dis-allow > duplicates - oughta be a law against them. > > do a query for the largest (max() function ) in an integer field, add one > and then INSERT new value. store the short varchar "rur" in another field. > Concat them when presenting to the user. Split them when the user posts a > request. See also str_pad function > > > > > ----- Original Message ----- > From: "Ignatius Reilly" <ignatius.reilly@free.fr> > To: "Win32 list PHP" <php-windows@lists.php.net>; "Pat Johnston" > <patj@ncable.net.au> > Sent: Thursday, December 05, 2002 11:12 PM > Subject: Re: [PHP-WIN] auto increment > > > > You can not do it straightforwardly. The required data type does not exist > > in MySQL. An auto_increment field is of type INTEGER. > > > > Ignatius > > ____________________________________________ > > ----- Original Message ----- > > From: "Pat Johnston" <patj@ncable.net.au> > > To: <php-windows@lists.php.net> > > Sent: Thursday, December 05, 2002 12:35 PM > > Subject: [PHP-WIN] auto increment > > > > > > > Hi > > > With php, just wondering if anyone knows if I can auto increment a > number > > > that has a part string? Is it possible to code this for an ID in MySQL > > > database? > > > > > > ie > > > rur01 > > > rur02 > > > rur03 > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >

« previous php.windows (#17311) next »