Re: [PHP4BETA] DB in PEAR and other questions

From: Date: Sat, 06 May 2000 08:31:46 +0000
Subject: Re: [PHP4BETA] DB in PEAR and other questions
Groups: php.version4 
Request: Send a blank email to php-version4+get-14577@lists.php.net to get a copy of this message
On 6 May 2000, Manuel Lemos wrote: > Hello Andrew, > > On 05-May-00 19:23:12, you wrote: > > >3) Also, has anyone wrapped the mysql function mysql_insert_id() in the > >mysql.php? > > The problem is that not all DBMS support auto incremented fields. If you > want to write portable database applications, you'd better not use tables > with auto incremented fields. If you don't want to write portable > applications, maybe it is better that you use mysql functions directly. > > > Regards, > Manuel Lemos > > Web Programming Components using PHP Classes. > Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org Manuel, It seems to me that because the of the way that the classes are set up in PEAR now, that is, DB_mysql extends DB_common, that it is logical to set this up. For example, because transactions are not possible under MySQL, calling the commit() and rollback() methods will result in an error DB_ERROR_NOT_CAPABLE. What should probably be happening is that for databases that are not able to support the function call to get the last inserted id that the function should return a DB_ERROR_NOT_CAPABLE like the way that it is handled now. Also, and hopefully I'm not making a obvious oversight here-- what DBMS do you know of that doesn't support auto incremented fields? Regards, Andrew

« previous php.version4 (#14577) next »