Thanks Paul,
That works fine. :)
>>On Tue, 7 Aug 2001 16:12:16 -0500, Paul DuBois <[EMAIL PROTECTED]> wrote:
>>>Hi All,
>>>
>>>Not sure if this is a bug or just a standard behavior of a auto_increment
>>>zerofill column.
>>>
>>>I have a column in a MySQL database table assigned as such:
>>>
>>>memid int(8) auto_increment zerofill primary key,
>>>
>>>now when the a new row is inserted in fills the column with the
>>>appropriate 0's,
>>>but when I do a 'SELECT LAST_INSERT_ID()', after the insert, I get the last
>>>insert number, without the zeros, IE... Last inserted id value =
>>>'00000012' but
>>>the return value is '12' and if I do a SELECT * FROM table_name WHERE memid =
>>>'12'; or SELECT * FROM table_name WHERE memid = '00000012';
>>>
>>>I get the same results, whether I use '12' or '00000012'
>>>
>>>Is this suppose to do that?? Just curious :)
>>
>>
>>LAST_INSERT_ID() returns a function value, not a table column value.
>>To get the result you want, you could use LPAD(LAST_INSERT_ID(),8,'0').
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225)686-2002
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php