his should print out whatever the primary key # of the last insert query
performed.
This help at all?
>From: Niklas Lampén <[EMAIL PROTECTED]>
>Reply-To: <[EMAIL PROTECTED]>
>To: "Php-General" <[EMAIL PROTECTED]>
>Subject: RE: [PHP] Getting the last record
Well, ofcourse you have to have the table + field names right. ;)
Niklas
-Original Message-
From: hugh danaher [mailto:[EMAIL PROTECTED]]
Sent: 18. tammikuuta 2002 9:38
To: [EMAIL PROTECTED]
Cc: Php-General
Subject: Re: [PHP] Getting the last record in a mysql table FINALLY
Niklas,
I needed to change the statement slightly, but it did put me on the right
track.
Thanks again,
Hugh
$result=mysql_query("SELECT id FROM my_table ORDER BY id DESC, id limit 1");
$id=mysql_result($result,0);
- Original Message -
From: Niklas Lampén <[EMAIL PROTECTED]>
To: Php-Gene
3 matches
Mail list logo