PDA

View Full Version : unsigned zerofill and clean_array_gpc


Lionel
15 Feb 2007, 17:03
I have a field in database set as INT (7) unsigned zerofill
The value in there is "0096071".

When I browse to ?mid=0096071&do=insert

and in the php do



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



$myid drops the zeros in front and becomes 96071

How can I make it read the zeros also?

Danny.VBT
15 Feb 2007, 18:12
Try TYPE_UNUM instead of TYPE_UINT.

Lionel
15 Feb 2007, 18:31
Thanks, but same results: missing zeros upfront. Temporary I removed the zero filled, but that is really no good for me.

Marco van Herwaarden
16 Feb 2007, 09:01
Storing values with zerofill is not really good coding practise.

Zerofill is a display attribute, not something you want to store and use internally in your scripts.

Lionel
16 Feb 2007, 09:03
problem is I am getting that value 0096071 from somewhere else, I am not creating it.

Marco van Herwaarden
16 Feb 2007, 09:16
Just store it without the zerofill.

Lionel
16 Feb 2007, 09:18
That's what I ended up doing and when I do a call back to other site I count the digits and simply place the missing zeros in front of it so the link matches.

Marco van Herwaarden
16 Feb 2007, 10:35
You would not need to count digits, simply format the number with sprintf().