create table invoice ( id int(6) zerofill primary key auto_increment, name varchar(30) );
now the id will store the int values, but when you quering the data then it will give with the leading zeros