Reply to Re: PHP 4.X and 64-Bit Integers from MySQL

Your name:

Reply:


Posted by Henk verhoeven on 04/12/07 22:54

Hi david,

Maybe you could use CONV(`columnname`, 10, 10) in your SQL to convert
the integer to a string before it is passed to php.

for example if the colum holding 64 bits integers is named `theInt`:

SELECT id, CONV(theInt, 10, 10) FROM yourtable

would return the id and theInt columns but theInt converted to a string.

Once the string is in php you may use GMP functions for calculations
etc., see http://nl2.php.net/manual/en/ref.gmp.php

Success,

Henk Verhoeven,
www.phppeanuts.org.

David T. Ashley schreef:
> I have a box where I'm forced to use PHP before 64-bit integers became
> standard ...
>
> If I run a MySQL query where one of the fields returned is 64-bit integer,
> how do I get this into PHP as a string? My recollection is that in the
> result sets it "auto types" so that it is an integer, and 64-bit integers
> will cause problems if one tries to assign into 32 bits.
>
> P.S.--Once into PHP as a string, I would use the bcmath library to
> manipulate it ...

[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

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