Date |Tue, 07 Aug 2001 13:59:05 -0500
>From |[EMAIL PROTECTED]

Hello!

M> Hi All,

M> Not sure if this is a bug or just a standard behavior of a auto_increment
M> zerofill column.

M> I have a column in a MySQL database table assigned as such:

M> memid int(8) auto_increment zerofill primary key,

M> now when the a new row is inserted in fills the column with the appropriate 0's,
M> but when I do a 'SELECT LAST_INSERT_ID()', after the insert, I get the last
M> insert number, without the zeros, IE... Last inserted id value = '00000012' but
M> the return value is '12' and if I do a SELECT * FROM table_name WHERE memid =
M> '12'; or SELECT * FROM table_name WHERE memid = '00000012';

M> I get the same results, whether I use '12' or '00000012' 

M> Is this suppose to do that?? Just curious :)
I think it's absolutely normal.
Lets think slightly.
when we compare to integer - why we need to look on leading zeroes ?

___________________________________________________________________
For technical support contracts, visit https://order.mysql.com/
This email is sponsored by SWSoft, http://www.asplinux.ru/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Grigory Bakunov <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB / SWSoft
/_/  /_/\_, /___/\___\_\___/
       <___/   www.mysql.com


---------------------------------------------------------------------
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

Reply via email to