> Ok, I have a string of bits that I combine to store as the privilege level
> for our users.... it is 5 chars long "12345", and the default is "00000"
> this would be the most basic user. now, when there is a non 0 number at
the
> front.... it works.... and every thing is cool.... but, even though the
> field is set as CHAR 5, if the privs number is set to 00110, it is stored
in
> the DB as 110.... or at least that is how it is retrieved.... in
> PHPmyAdmin.... it shows up as 00110....
>
> so anyway, somewhere it is stripping the leading 0's off the number, and I
> need to know why and how to fix that.....

This is a job for the SET data type in MySQL!  Even though the SET type
returns a list of legible strings it stores information in a bitmap, as
compactly as possible.  See:

   http://www.mysql.com/doc/S/E/SET.html


If you can't switch to sets, consider switching to a string of non
numeric characters, or make the first character in your string non
numeric. It wont get mangled by type conversions, and leading zero
supression that way.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to