RE: PHP/mySQL dropping zeros after inserting number into record

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



char(14) is a better data type

bastien


----------------------------------------
> Date: Sat, 16 Feb 2008 15:22:17 -0800
> From: gouldimg@xxxxxxx
> To: php-general@xxxxxxxxxxxxx
> Subject:  PHP/mySQL dropping zeros after inserting number into record
> 
> I've got a PHP script that inserts "00012345678" into a record in a mySQL database (it's a barcode).  Things work ok unless the number has preceding zeros, and then the zeros get cut off and all I get is "12345678".
> 
> I have the mySQL database fieldtype set to bigint(14).  If the maximum length a barcode can be is 14, is there a better fieldtype to use that will keep the zeros?
> 
> (or some way for PHP to tell mySQL not to chop off the zeros?)
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

_________________________________________________________________

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux