Well, you don't need the distinct.

Are you inserting with your PHP script?  LAST_INSERT_ID(), as per the manual, 
only returns the id from the last insert on that connect.  You cannot get the 
LAST_INSERT_ID() for another connection.

j----- k-----

On Wednesday 05 May 2004 05:11 pm, Erich Beyrent said something like:
> Hi there,
>
> I seem to be having a problem retrieving the last inserted ID for a
> table.
>
> The query I am using is as follows:
>
> mysql> select distinct LAST_INSERT_ID() as LastID from listings;
> +--------+
>
> | LastID |
>
> +--------+
>
> |   3575 |
>
> +--------+
> 1 row in set (0.00 sec)
>
> However, when I run this from my PHP script, I get a value of 0.
>
> Any clues as to how to resolve this?
>
> Thanks!
>
> -Erich-

-- 
Joshua J. Kugler -- Fairbanks, Alaska -- ICQ#:13706295
Every knee shall bow, and every tongue confess, in heaven, on earth, and under 
the earth, that Jesus Christ is LORD -- Count on it!

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to