what is the column type of the database? If it's a string or text, you should be fine. IF it's an integer, there's the problem!!
Although, if you're going to always have 5 digits, you could always pad-left:
$string = "456";
$newstirng = str_pad($string, 5, "0", STR_PAD_LEFT);
echo $newstring;
That should give you:
00456
~Brett