Bug #16383 Updated: mysql_fetch_assoc returns strings only
| From: | derick@php.net | Date: | Tue, 02 Apr 2002 20:02:13 +0000 |
| Subject: | Bug #16383 Updated: mysql_fetch_assoc returns strings only | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-3852@lists.php.net to get a copy of this message | ||
ID: 16383
Updated by: derick@php.net
Reported By: suraev@tut.by
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: Win2000
PHP Version: 4.1.1
New Comment:
a. MySQL returns only strings with the C api call
b. PHP is typeless
c. it has been ages like this
d. In order to 'fix' this, we need to call atleast 4 new api calls,
thus slowing down queries a LOT
This change is not going to happen.
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-04-02 14:47:55] suraev@tut.by
Why you decide that it's a support question?
No, you are not right. It's not important for me, as I found a way to
make my scripts work fine even with this error.
But I still think that php development team should know that their
function doesn't work the way it has to.
If function has to return an array with integer value, but returns an
array with string value - it's a bug.
That's why I wrote here.
Sincerely, Val suraev@tut.by
------------------------------------------------------------------------
[2002-04-01 16:39:44] derick@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php
------------------------------------------------------------------------
[2002-04-01 16:30:05] suraev@tut.by
Hello,
I found a strange behaviour while was working with mysql_fetch_array
and mysql_fetch_assoc.
Even if table has an integer field, the result I got from functions
listed above will list this value as string.
php.ini
magic_quotes_runtime = Off
simple example.
imagine that we
"create table tripreport (ID tinyint)"
then we "insert into MYTABLE (ID) values (1)"
then $r="select * from MYTABLE where ID=1"
then $f=mysql_fetch_assoc($r);
then $id=$f["ID"];
then echo gettype($id) will print "string".
is it an internal MySQL bug of PHP makes a mistake?
take care, Val
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16383&edit=1