[man]strpad()[/man] to do it in PHP
LPAD() to do it in MySQL
Just left pad them in the SELECT as putting extra zeros on the INSERT will do nothing (assuming your ids are stored as integers, which they should be).
HTH
Bubble
[edit]
Ooooh, ZEROFILL, not seen that before.
Glad I didn't go with my straight "No can't do that" answer 🙂
[/edit]