php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31600 mysql_fetch_assoc returns strange chars as result indexes
Submitted: 2005-01-18 17:57 UTC Modified: 2005-01-19 16:26 UTC
From: mveutner at iptel-ulm dot de Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.0.3 OS: Windows 2000 SP4
Private report: No CVE-ID: None
 [2005-01-18 17:57 UTC] mveutner at iptel-ulm dot de
Description:
------------
Hello,

searched the web, google, faqs, and lot more.
No result.
The problem:
Updated php4 last stable to php5 last stable.
Now every mysql_fetch_assoc($result) returns strange characters as array index.
Tried to change libmysql.dll which was packed with php5 to the version packed with mysql.
No result.
This problem does NOT happen when I execute a query with named columns (SELECT `Name`, `Surname` From customers).
My Configuration:
PHP 5.0.3
Apache Version  Apache/1.3.33 (Win32) mod_ssl/2.8.22 OpenSSL/0.9.7e  
Mysql Server: 4.1.7-nt
The complete environment (output of phpinfo()) can be found at:
http://paracom.iptel-online.de/info.php




Reproduce code:
---------------
$str_sql="SELECT * FROM customers";
$rs_res = mysql_query($str_sql, $conn) or die("Error in query 2 $str_sql" . mysql_error($conn));
$ln_res = mysql_fetch_assoc($rs_res)


Expected result:
----------------
print_r($ln_res) should look like:

array(Name=>value,Surname=>value ...)

Actual result:
--------------
Array ( [B] => 1 [@] => 99999 [] => 1 [?] => 0000-00-00 ) 

This means: resulting array from mysql_fetch_assoc returns no more any valid column names. Instead returning strange characters.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-18 18:29 UTC] mveutner at iptel-ulm dot de
Test page with more detailed results for this issue:

http://paracom.iptel-online.de/test.php
 [2005-01-19 15:05 UTC] mveutner at iptel-ulm dot de
I am very sorry! Daily maintance restarted server tonight and today: All works fine.
Sorry for the trouble!
 [2005-01-19 16:26 UTC] johannes@php.net
No PHP Bug -> Bogus 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 22:01:26 2024 UTC