Re: Problems with strings being handled like numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/14/05, Richard Lynch <ceo@xxxxxxxxx> wrote:

> mssql_* and PHP "know" that the data is supposed to be "integer"
> 
> But the largest integer that PHP can store is 0xFFFFFFFF.
> 
> So when PHP tries to accept the "integer" from mssql_fetch_row, it's
> got no room to store it as integer, and HAS to convert it to float.


Ah, OK. I was beginning to suspect it might be that; thanks for confirming.

If you JUST want to display it, and not manipulate it in PHP, you can
> ignore that bit about BC_MATH and the other extension.


Yes, these serial numbers have no mathematical significance. In fact, I'm 
not even sure why they're stored as numbers in the database at all...maybe 
for performance reasons, my database design knowledge is still pretty 
minimal so I can't comment on that (I didn't create the database).

You'll need to use the typecast to char in MSSQL no matter what, cuz
> ain't no way PHP is gonna store an integer bigger than 0xFFFFFFFF as
> an integer.
> 

OK...knowing that, doing the typecast in the SQL query doesn't seem 
inelegant any more. Thanks for the info!

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux