In mysql update the number in the column that it would be 9 digits
for example:
658 were recorded, but must be 000000658,
if 96258, this must be 000096258, front contributed to 0.
Thanks
In mysql update the number in the column that it would be 9 digits
for example:
658 were recorded, but must be 000000658,
if 96258, this must be 000096258, front contributed to 0.
Thanks
I think you'll have to change the datatype from int to varchar(9). Just have your code add on the zero's before committing to your database.
Example in PHP:
$foo = "604";
while(strlen($foo) < 9)
{
$foo = "0".$foo;
}
$foo now equals 000000604. All you would need to do is write a loop to pull from your database and commit back to it.
While creating column use this:
ALTER table `table` CHANGE `column` `column` VARCHAR(9);
While inserting or updating data use this:
UPDATE table SET `column` = LPAD(`column`, 9, '0'); #pads everything