php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #36863 No set_charset method despite libmysql 5.0.18 and php 5.1.2
Submitted: 2006-03-26 13:00 UTC Modified: 2006-04-03 17:45 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: joustin at post dot pl Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.1.2 OS: Windows
Private report: No CVE-ID: None
 [2006-03-26 13:00 UTC] joustin at post dot pl
Description:
------------
MYSQL Client API version 	5.0.18
PHP 5.1.2 (cli) (built: Jan 11 2006 16:40:00)

Cannot call set_charset method of mysqli object!

Reproduce code:
---------------
$c = new mysqli('localhost','root','','test');
if($c)
var_dump(method_exists($c,'set_charset'));

Expected result:
----------------
true

Actual result:
--------------
false


Export Table:
  Name:                          LIBMYSQL.dll
  Time Date Stamp:               0x43B2E430 (2005-12-28 21:14:56)
  Version:                       0.00
  Ordinal Base:                  1
  Number of Functions:           150
  Number of Names:               150

  Ordinal   Entry Point   Name
[...]
       58   0x00014E50    mysql_get_character_set_info
       59   0x00014D20    mysql_get_client_info
[...]
       99   0x00003BB0    mysql_set_character_set
[...]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-26 13:07 UTC] tony2001@php.net
It doesn't depend on the version you have installed, it depends on the version it was built against.
AFAIK 4.x is used for Windows builds.
 [2006-03-26 13:18 UTC] joustin at post dot pl
On win32 PHP it all depends on libmysql.dll (taken from php dir or env) and php_mysqli.dll extension.

Changing libmysql.dll changes the "Client API version" reported by phpinfo(). Checked against other Mysql 5.x specific functions.

See man for set_charset()
 [2006-03-26 13:27 UTC] joustin at post dot pl
Tried newest build:
PHP 5.1.3RC2-dev (cli) (built: Mar 26 2006 12:18:57)
... and no effect.

Btw: the mysql server is also ver 5.0.18, win32 build on dedicated win2003 server.

Tried with 5.1.2 php on linux, also mysqli with Client API version => 5.0.18. Working flawlessly!
 [2006-03-26 13:48 UTC] tony2001@php.net
You can change the library as many times as you want, but the function will not appear magically because the .dll was compiled against older library.
 [2006-03-26 13:57 UTC] joustin at post dot pl
So what does the following refer to? 
Note: To use this function on a Windows platform you need MySQL client library version 4.1.11 or above (for MySQL 5.0 you need 5.0.6 or above) 

http://www.php.net/manual/en/function.mysqli-set-charset.php

Are you suggesting it's impossible to get mysql5 support in php5 for win32 unless re-compiled ?
 [2006-03-26 16:55 UTC] kleef84 at hotmail dot com
You can download the latest mysql connector for PHP5 from the mysql site at http://dev.mysql.com/downloads/connector/php/
 [2006-03-26 21:18 UTC] georg@php.net
PHP can't provide actual binaries for MySQL 4.1, 5.0 (and 5.1 soon). Please download the version you need from the MySQL website.
 [2006-03-27 08:37 UTC] joustin at post dot pl
Thanks for solution, though this really needs proper documenting.

http://www.php.net/manual/en/function.mysqli-set-charset.php
 [2006-04-03 17:45 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 22:01:33 2025 UTC