I am using data field Nr. int(10) not null autoinc. in a table
so that when user calls this field he will get this Nr. as 1,2,3---autoincrmenbts whenever he login,but i want some function in PHP so that when user login he will get 001 instead of 1 and 010 instead of 10 not as 0010.
please guide me----
You can do this in the database - in MySQL, you add the attribute ZEROFILL to the column declaration. I presume other databases have similar functionality.
Or, if u really want to do it through php, use string functions, in a little script.
thanks for the help but i am a newbie to PHP and mySQL i tried to use
nr [tinyint(10) or int(10)] [UNSIGNED] [ZEROFILL] [No] [auto_increment ]
and when i give value to nr as 1 it always take as 0000000001
so i dont no how to reduce these much zeroes i want as 001 or please help me to write the function using PHP or how i can directly fill 001 in database.
I will be very thankful ......
You are currently defining the length as 10. Try setting that to 3.
Note: Please do not start new threads on the same topic. The other thread has been deleted.
i will take care about this new thread actually i am new user ---
Users Browsing this Thread
There are currently 1 users browsing this thread.
(0 members and 1 guests)