Re: invalid select results from sybase with php - SOLVED
| From: | David Olszyński | Date: | Mon, 07 May 2001 22:09:37 +0000 |
| Subject: | Re: invalid select results from sybase with php - SOLVED | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9155@lists.php.net to get a copy of this message | ||
David Olszyński wrote:
> Hello.
>
> I have a strange problem. Look:
>
> $query = "select id from rates where id = 9500000000000021.0";
> $result = sybase_query($query);
> $a = sybase_fetch_row($result);
> echo $a[0];
>
> This code prints number 9500000000000020.0!!!
>
> The column id is auto-incremented so it always has a unique value. But
> when I select values from this column using php I get a list like this:
> 9500000000000020.0
> 9500000000000020.0
> 9500000000000022.0
> 9500000000000024.0
> 9500000000000024.0
> 9500000000000024.0
> ...,
> while doing the same query from isql or from perl DBI I get correct
> values: 9500000000000020
> 9500000000000021
> 9500000000000022
> 9500000000000023
> 9500000000000024
> 9500000000000025
> ...
>
> Can anyone help me with this?
>
> I use PHP 4.0.4pl1 (./configure --with-mysql --with-apache=../apache
> --enable-track-vars --enable-trans-sid) compiled in Apache/1.3.19, Linux
> 2.4.2 SMP, Sybase 11.9.2.4, RedHat 7.0.
>
> David Olszynski
>
I couldn't believe it: The problem is that php can't handle such big
numbers! :-O
Damned language! ;-)
David Olszynski