Re: [phplib] mysql:last_insert_id() From: Björn Schotte (bjoern <email protected>)
Date: 04/11/01

* Peter Niederlag wrote:
> $sqlquery1="INSERT INTO fragen(Frage_Text, F_Kat_Id) VALUES
> (\"$fragetext\"),\"$f_kat_id\")";
> => so far I don't INSERT any id's and let mysl do the job with
> auto_increment.

Yes. Either you do this or you switch to nextid() method
which is known to work with any supported RDBMs.
 
> This way i dont know how to get the id mysql assigned.
> Is there any way to get the id, or do i have to change using the
> $db->nextid(seq_name) function of db_mysql.inc?

If you use nextid(), there's no need to put specific
RDBMS PHP functions like mysql_insert_id() in your
PHP code.

> Are there any other reasons for using $db->nextid(seq_name) ?

auto_increment is a special feature of MySQL that
is not neccessarily known to other RDBMs.

-- 
Björn Schotte                                      bjoern <email protected>
http://rent-a-phpwizard.de/                   bjoern <email protected>

PHP Schulungen, Softwareentwicklung, Coaching

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>