Re: Preserving the string
| From: | Owen Prime | Date: | Tue, 15 Oct 2002 02:52:41 +0000 |
| Subject: | Re: Preserving the string | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22398@lists.php.net to get a copy of this message | ||
Sounds like it must be getting cast to a number somewhere along the track.
You probably have been here, but make sure that:
1. You are not performing any mathamatical calculations or comparisons on
them.
2. When putting then in the DB make sure the string of numbers is quoted.
Try var_dump($string_of_numbers) to see if it has the leading 0's and what
its type is immediately before you insert into the DB.
Cheers,
Owen Prime
http://www.noggin.com.au
Michael Conway wrote:
> I have a problem using barcodes. They are variable in length (up to 13
> integers). I had to add them to the tables a strings (varchar(13)) to
> preserve the leading zeros that are not uncommon. The problem comes
> with inserting these barcodes into other tables (passing them using
> href). When using a shopping cart application and inserting the barcode
> from the product table into the items table (to store the user's
> shopping cart contents), the leading zeros are lost. Needless to say
> that using the original tables with the true barcodes to verify the
> contents of the user's cart for purchases and pricing subsequently
> fails. Is there a way to ensure the string is preserved in its entirety
> when added to a new table using scripts?
>
>
>
> Michael Conway
>
> mconway3@cox.net
>
> (703) 968-8875