NYCPHP Meetup

NYPHP.org

[nycphp-talk] TRUNCATING MySQL FIELDS

tedd tedd at sperling.com
Sun Jul 29 09:46:03 EDT 2007


>On July 28, 2007, PaulCheung wrote:
>
>>  When I set the table up I set the LICENCE to INT(8). When populating this
>>  field I was expecting any number larger than 8 digits to be truncated and
>>  any number less than 8 digits to be padded out with zeros, in both cases
>  > this is not happening.


Randomize a number, convert it to a string, pad and truncate as you 
want and use a string and not int.

Cheers,

tedd


-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the talk mailing list