List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 13 2000 4:35pm
Subject:Re: Insertid CORRECTION
View as plain text  
At 1:52 PM -0600 03-10-2000, John wrote:
>I was informed that this is incorrect, and must agree THIS IS INCORRECT. It's
>$dbh->{mysql_insertid}; If you use $sth it's $sth->{insertid}; My 
>apologies to the
>list serve. Don't post with NULL sleep ladies and gentlemen, it can 
>be disastrous
>to readers and your ego alike. Sorry everyone.
>John

Actually, $sth->{insertid} may still work, but that is a statement handle
attribute that is now deprecated in favor of the database handle attribute
$dbh->{mysql_insertid}.  The only reason the former should be used is if
you happen to be working with a version of DBD::mysql that doesn't yet
support $dbh->{mysql_insertid}.


>
>John wrote:
>
>>  Hello Calvin,
>>      Try
>>  $new_id = $sth->{mysql_insertid};
>>
>>  John
>>  Mage Software, Inc.
>>  http://www.magesoft.com
>>
>>  Calvin Wells wrote:
>>
>>  > > $new_id = $sth->{insertid};
>>  > > Does any use insertid to return the last auto_increment value? 
>>I tried it,
>>  > > but it didn't seem to work.
>>  > >
>>  > >
>>  > > Calvin Wells MCSE, CNE, CCNA, CCSA
>>  > > Network Administrator
>>  > > Bisk - Totaltape Publishing Company
>>  > >
>>  > >
>>  > >
>>  >
>>  > --
>>  > ---------------------------------------------------------------------
>>  > Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>>  > posting. To request this thread, e-mail mysql-thread29349@stripped
>>  >
>>  > To unsubscribe, send a message to:
>>  >     <mysql-unsubscribe-mysql=turtle.magesoft.com@stripped>
>>
>>  --
>>  ---------------------------------------------------------------------
>>  Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>>  posting. To request this thread, e-mail mysql-thread30788@stripped
>>
>>  To unsubscribe, send a message to:
>>      <mysql-unsubscribe-mysql=turtle.magesoft.com@stripped>
>
>
>--
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail mysql-thread30839@stripped
>
>To unsubscribe, send a message to:
>     <mysql-unsubscribe-paul=snake.net@stripped>


-- 
Paul DuBois, paul@stripped
Thread
InsertidCalvin Wells29 Feb
  • Re: Insertidsinisa29 Feb
  • Re: InsertidJohn10 Mar
  • Re: Insertid CORRECTIONJohn10 Mar
    • Re: Insertid CORRECTIONPaul DuBois13 Mar