Re: issue with zerofills and DataObject

From: Date: Sun, 30 Oct 2005 20:37:49 +0000
Subject: Re: issue with zerofills and DataObject
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21709@lists.php.net to get a copy of this message
On 10/30/05, Dan Rossi <pear@electroteque.org> wrote: > Hi , im experiencing a strange issue with zerofill columns and > DataObject, while attempting to return a field value of 012 its > becoming 12 , even when explicity converting the field in mysql , the > query returns 012 but in php its 12 , im hoping to try and increment > this in a form, so am wanting 013 instead of 13 any ideas ? > Is your code (or some other) using the value as a number? Likely when it first comes in it's a string which is '012' but if you do something like increment it it will turn into a number and lose its 0. You'll have to re-pad it (if the DB doesn't do it for you). -- Justin Patrin

« previous php.pear.general (#21709) next »