Possible bug in mysql_fetch_array et al

From: Date: Wed, 22 Sep 2004 21:45:40 +0000
Subject: Possible bug in mysql_fetch_array et al
Groups: php.db 
Request: Send a blank email to php-db+get-36348@lists.php.net to get a copy of this message
My understanding of mysql_fetch_array () is that when supplied with one value only (a result_set) this will return an array indexed both numerically and associatively by field name. The result set would take the form: array(59) { [0]=> string(4) "9542" ["ORDER_ID"]=> string(4) "9542" .. Where both the [0] and ["ORDER_ID"] indexes should contain the same value. If my understanding is correct then I have found some aberrant behavior in the return of a particular result_row. Unlike the above the array contains different values for numeric and associative indexes. Furthermore the associative value contains an uncommon character. Example below: array(59) { [0]=> string(4) "9542" ["ORDER_ID"]=> string(4) "31[]3" .. In the above var_dump the [] actually appears as a small box and I cannot copy and paste it. The numerically indexed value (i.e. [0]=>string(4) "9542") is correct. The associatively indexed value (i.e. ["ORDER_ID"]=>string(4) "31[]3") is completely bogus. Has anyone else seen this behavior? Is there a fix for it? Any pointers would be appreciated... I have tried adding a value MYSQL_ASSOC to the mysql_fetch_array and I have tried using mysql_fetch_assoc. Both return the same bogus value. Daniel Watrous

« previous php.db (#36348) next »