Bug #15111 Updated: mysql_fetch_array() returns bad array

From: Date: Sat, 19 Jan 2002 08:33:04 +0000
Subject: Bug #15111 Updated: mysql_fetch_array() returns bad array
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-77505@lists.php.net to get a copy of this message
ID: 15111 Updated by: sander Reported By: compman86@home.com Old Status: Open Status: Bogus Bug Type: MySQL related Operating System: Windows 2000 PHP Version: 4.1.1 New Comment: mysql_fetch_array contains each field twice (numeric, and with fieldnames). RTM on mysql_fetch_row, mysql_fetch_array, and mysql_fetch_assoc. Previous Comments: ------------------------------------------------------------------------ [2002-01-18 23:59:35] compman86@home.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

« previous php.dev (#77505) next »