List:General Discussion« Previous MessageNext Message »
From:Graham Ashton Date:May 30 1999 11:32am
Subject:Re: last_insert_id() - strange ??
View as plain text  
On Saturday 29 May, Darren Sweeney wrote:

> Thanks .. the only problem is I have 8 tables in the dB .. how will it
> know which one to look at?

this has already been answered elsewhere.

> I need to be able to call this in Perl and then use something like
> $lastid = $sth->fetchrow; to get the value... 

I assume you're using DBI and the mysql DBD driver. if that's the case,
search through the driver's docs for "insertid". you can do this;

  my $last_id = $sth->{"insertid"};

it's not portable to other databases though.

-- 
Graham
Thread
last_insert_id() - strange ??Darren Sweeney30 May
  • Re: last_insert_id() - strange ??Jim Faucette30 May
Re: last_insert_id() - strange ??Darren Sweeney30 May
  • Re: last_insert_id() - strange ??Paul DuBois30 May
  • Re: last_insert_id() - strange ??Graham Ashton30 May
Re: last_insert_id() - strange ??Darren Sweeney30 May
  • Re: last_insert_id() - strange ??Jim Faucette30 May