- 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:
>>
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
> yo
Wednesday, April 17, 2002 1:15 PM
Subject: [PHP] mysql quickie..
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 i
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..
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 200
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?
Thanks
Kelly
--
PHP General Mailing List (http://www.php.net/)
T
6 matches
Mail list logo