Re: Incrementing Primary Key

From: Date: Wed, 27 Oct 2010 13:30:57 +0000
Subject: Re: Incrementing Primary Key
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-47445@lists.php.net to get a copy of this message
Yes indeed, as Jimmy says, having a database for each site is impractical and a waste of resources. On 27 October 2010 11:23, Jimmy Sole <jimmysole@gmail.com> wrote: > In my opinion, having a database for each site would require a lot of unnecessary work, as you > would have to connect to every database in order to handle the sites. > Having one database with tables for all the sites would be more productive as you would not > have to change the connection info for PHP every time you want to use a different database. > I use the PDO mysql adapter, what do you use? > > -----Original Message----- > From: Andrés G. Montañez [mailto:andresmontanez@gmail.com] > Sent: Wednesday, October 27, 2010 9:19 AM > To: Ethan Rosenberg > Cc: php-db-lists.php.net > Subject: Re: [PHP-DB] Incrementing Primary Key > > Hi Ethan, > in this case, you should manage the "keys" by your application, and store the used > ids in aonther table, similar to a "sequence" in Oracle or Postgresql. > Thats so if you want all the records un one table (a field for the letter, and the other for > the numeric part). > > Otherwise, having a table for each site will be enough, as Jimmy suggests.. > > -- > Andrés G. Montañez > Zend Certified Engineer > Montevideo - Uruguay > > -- > PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: > http://www.php.net/unsub.php > > > -- Andrés G. Montañez Zend Certified Engineer Montevideo - Uruguay

« previous php.db (#47445) next »