#21875 [Fbk->Bgs]: mysql_fetch_array delivers wrong result
| From: | georg@php.net | Date: | Sat, 25 Jan 2003 14:37:50 +0000 |
| Subject: | #21875 [Fbk->Bgs]: mysql_fetch_array delivers wrong result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-31216@lists.php.net to get a copy of this message | ||
ID: 21875
Updated by: georg@php.net
Reported By: c.bock@qbiz.de
-Status: Feedback
+Status: Bogus
Bug Type: MySQL related
Operating System: Windows 2k / SuSE Linux 7.3
PHP Version: 4.3.0
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
When using mysql_fetch_array you have to specify an alias for numbers
or you have to specify optional parameter MYSQL_ASSOC/MYSQL_NUM (and
not MYSQL_BOTH).
Previous Comments:
------------------------------------------------------------------------
[2003-01-25 06:11:39] derick@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2003-01-25 06:05:16] c.bock@qbiz.de
I have a small table, having only two columns (id + name). For keeping
my PHP code general, i executed the following SQL Statement:
"select name, id, 1 from tablename"
The Result was:
+----+------+---+
| id | name | 1 |
+----+------+---+
| 1 | 1 | 1 |
| 2 | 1 | 1 |
| 3 | 1 | 1 |
| 4 | 1 | 1 |
+----+------+---+
Later on, i tried the same statement with 0 instead of 1, and the id
was all set to 0.
The workaraound, i found was writing "select name, id, 1 as type from
tablename", which worked fine for me.
I've checked, if mySQL delivers a correct result and it does. I have
not checked, if this is a general database problem.
Thanks in advance and keep up the great work!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21875&edit=1