You are here: Re: LAST_INSERT_ID with ZEROFILL « PHP Programming Language « IT news, forums, messages
Re: LAST_INSERT_ID with ZEROFILL

Posted by Michael Fesser on 10/18/07 19:06

..oO(WebSnozz)

>I am losing the leading zeros when I get autoincrement IDs from a
>column with ZEROFILL enabled.

I wouldn't rely on that.

>I would like to have the leading
>zeros. I have tried both the php function last_insert_id as well as
>running a SELECT query and using the result. I am getting the correct
>id, it is just losing the leading zeros. I have doulbe checked the
>table in the database, and it does have the leading zeros. Thanks for
>any help.

Just store normal integers and add the leading zeros when you really
need them, for example with sprintf() in your script

Micha

 

Navigation:

[Reply to this 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

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