$dbh->last_insert_id() not working
From: Daniel Kasak (dkasak_at_nusconsulting.com.au)
Date: 06/17/04
- Previous message: Jeff Urlwin: "RE: Best Way to Auto Increment with Oracle"
- Next in thread: Beau Frusetta: "Re: $dbh->last_insert_id() not working"
- Reply: Beau Frusetta: "Re: $dbh->last_insert_id() not working"
- Reply: Tim Bunce: "Re: $dbh->last_insert_id() not working"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 17 Jun 2004 12:06:29 +1000 To: dbi-users@perl.org
Hi all.
I'm using DBI-1.42, Perl-5.8.4, MySQL-4.0.18 and DBD::MySQL-2.9003.
I'm trying to get the ID of the last inserted record.
I can use:
> $dbh->{'mysql_insertid'}
and it returns the correct value, however if I change the above to:
> $dbh->last_insert_id()
it doesn't work. It returns undef.
I'd like to use last_insert_id() because I want to be able to use this
bit of code to handle updates with different databases.
What's up?
-- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: dkasak@nusconsulting.com.au website: http://www.nusconsulting.com.au
- Previous message: Jeff Urlwin: "RE: Best Way to Auto Increment with Oracle"
- Next in thread: Beau Frusetta: "Re: $dbh->last_insert_id() not working"
- Reply: Beau Frusetta: "Re: $dbh->last_insert_id() not working"
- Reply: Tim Bunce: "Re: $dbh->last_insert_id() not working"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|