Re: Pear DB LastInsertID
| From: | Martin Tsachev | Date: | Thu, 11 Jul 2002 23:40:54 +0000 |
| Subject: | Re: Pear DB LastInsertID | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1858@lists.php.net to get a copy of this message | ||
LIMBOURG Arnaud wrote:
The advantage of a sequence is that it is *not* linked to a table.Is it an advantage when you want to use something like MySQL's auto_increment/PostgreSQL's SERIAL (PostgreSQL also supports sequences though). I don't have experience with other databases but I don't think I should have twice the tables I want (half of them ending with _seq).
Specifiying a table and a column isn't the best way to go imho. Yes it should be table only.
Arnaud.Peter I don't think that anything should be up to the end uset with PEAR. -- Martin Tsachev Web developer http://members.evolt.org/shaggy/The best way IMO would be to change the nextID function to take two parameters: table_name and col_name. It would be up to the end user to create a sequence on the table column (in databases that supported it) - and for databases that don't the driver class could behave as they do at the moment, creating another table and updating the number in the column.