Posted by Jim Moseby on 12/15/05 17:10
>
> I¹m trying to figure out how to do this but am not sure.
> Any help appreciated.
>
I'm not sure of what you are asking, but I'll assume that because you posted
the to the PHP list, that you are asking how to take a MySQL autoincrement
number and add leading zeros to it.
Try this:
$row=mysql_fetch_array($result);
$four_digit_id=str_pad($row['id'], 4, "0", STR_PAD_LEFT);
JM
[Back to original message]
|