RE: [PEAR] DB.php version of mysql_insert_id()
| From: | Andreas Otterstein | Date: | Fri, 19 Dec 2003 05:39:22 +0000 |
| Subject: | RE: [PEAR] DB.php version of mysql_insert_id() | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9694@lists.php.net to get a copy of this message | ||
Hi Mike,
this is a mysql-specific function.
Many other DB systems doesn't support 'auto_increment'.
They are using trigger and views.
The DB class is an abstraction for many database systems.
Please use sequences instead of mysql_query with an insert AND
mysql_inserted_id().
In the PEAR-Manual there is a section about sequences in the DB class.
http://pear.php.net/manual/en/package.database.db.intro-sequences.php
You can only read the value of the last inserted ID if you look into the
seq_<table>.
Best wishes,
Andy
-----------------------
Von: Mike Zornek [mailto:listguy@mikezornek.com]
Gesendet: Mittwoch, 17. Dezember 2003 16:55
An: pear-general@lists.php.net
Betreff: [PEAR] DB.php version of mysql_insert_id()
I use mysql_insert_id() in PHP to retrieve the ID of the last INSERTed
record. I'm trying to do this in PEAR's DB.php but can't see how.
http://www.php.net/manual/en/function.mysql-insert-id.php
Little help?
~ Mike
Web Designer, Media Developer, Programmer and Geek http://MikeZornek.com
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php