Reply to RE: [PHP] 4 Digit ID with Leading Zeros

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация