[thelist] basic mysql key question.

Andrew Forsberg andrew at thepander.co.nz
Tue Apr 23 01:32:01 CDT 2002


On Mon, 2002-04-22 at 22:44, Edwin Martin wrote:

> Use mysql_insert_id() to get the id of the last inserted row.
>
> See:
> http://www.php.net/manual/en/function.mysql-insert-id.php

Or, create a sequence with PEAR and you'll know what the ID will be
*before* you insert it:

http://lists.evolt.org/index.cfm/a/harvest/b/detail/c/_/d/4471

http://pear.php.net/manual/en/core.db.nextid.php

Cheers
Andrew





More information about the thelist mailing list