Kelly-
My way may not be perfect, but this is what I do.
$sql_temp = select last_insert_id() as mainid from transfers;
$sql_result_temp = mysql_query($sql_temp,$connection);
$row_temp = mysql_fetch_array($sql_result_temp);
$file_temp_id = $row_temp[mainid];
-Scott
On Wed, 17 Apr 2002,
Kelly Meeks wrote:
Hi folks,
I need to get the next auto_increment value of a mysql table thru php.
Looking at my mysql manual, it makes reference to a last_insert_id() function?
How would I use this via php, or is there some other way to do it?
Quickly and hardly accurately... but
I've seen other responses to your request answer with some VERY UGLY methods
to get the last id.
Instead, use mysql_insert_id() which was created specifically for the info
you need.
- Original Message -
From: Kelly Meeks [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 17,
Richard Emery wrote:
I've seen other responses to your request answer with some VERY UGLY methods
to get the last id.
Hey my method wasn't ugly, perhaps not optimal, but definately not ugly!
So *ptht* ;)
Instead, use mysql_insert_id() which was created specifically for the info
you
- Original Message -
From: Robert Cummings [EMAIL PROTECTED]
To: Richard Emery [EMAIL PROTECTED]
Cc: Kelly Meeks [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, April 17, 2002 1:49 PM
Subject: Re: [PHP] mysql quickie..
Richard Emery wrote:
I've seen other responses to your
5 matches
Mail list logo