ID: 15111
Comment by: laboom at abv dot bg
Reported By: compman86 at home dot com
Status: Bogus
Bug Type: MySQL related
Operating System: Windows 2000
PHP Version: 4.1.1
New Comment:
I have the same problem - I LIMIT the sql query to 15 but I get 18. I
use "do{...} while ($myrow = mysql_fetch_array($result));" When I debug
it I find out that $myrow contains more fields than needed - some of the
fields are returned three times (twice as normal + 1 unnecessary). For
example $myrow:
0 : "36939611"
pl_id : "36939611"
..
9 : "yes"
pl_train : "yes"
10 : "36939611"
11 : "Alexander Donchev"
pl_name : "Alexander Donchev"
...
Previous Comments:
------------------------------------------------------------------------
[2002-01-19 03:33:04] [EMAIL PROTECTED]
mysql_fetch_array contains each field twice (numeric, and with
fieldnames). RTM on mysql_fetch_row, mysql_fetch_array, and
mysql_fetch_assoc.
------------------------------------------------------------------------
[2002-01-18 23:59:35] compman86 at home dot com
I have a table with 10 columns. I queried the mysql database to return
only 5. I used mysql_fetch_array($queryID) to get an array of data to
work with. When I did count(mysql_fetch_array($queryid)) it returned 8.
When I did mysql_num_fields($queryid) it returned 5. Also, when I try to
access the array returned from mysql_fetch_array as a numeric array, it
doesn't work. It doesn't give warnings, but it doesn't give any data.
Here is some sample code:
$qid = mysql_query("SELECT a,b,c,d,e FROM table1");
echo mysql_fetch_array($qid);
echo mysql_num_fields($qid);
echo count(mysql_fetch_array($qid));
Thankyou for your time! =)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15111&edit=1