php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34902 $mysqli::character_set_name() - undefined method
Submitted: 2005-10-18 09:07 UTC Modified: 2005-10-18 12:02 UTC
From: max at webscript dot ru Assigned:
Status: Closed Package: MySQLi related
PHP Version: 5CVS-2005-10-18 (snap) OS: Windows XP Pro
Private report: No CVE-ID: None
 [2005-10-18 09:07 UTC] max at webscript dot ru
Description:
------------
Method character_set_name() is undefined but procedural style works fine.

PHP 5.1.0RC4-dev 
MySQL client - 4.1.14


Reproduce code:
---------------
// procedural style (works fine)
$conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
var_dump(mysqli_client_encoding($conn));
var_dump(mysqli_character_set_name($conn));
mysqli_close($conn);
// oop style - got error
$conn = new mysqli($db_host, $db_user, $db_pass, $db_name);
var_dump($conn->client_encoding());
var_dump($conn->character_set_name());
$conn->close();     


Expected result:
----------------
string(17) "latin1_swedish_ci"
string(17) "latin1_swedish_ci"
string(17) "latin1_swedish_ci"
string(17) "latin1_swedish_ci"

Actual result:
--------------
string(17) "latin1_swedish_ci"
string(17) "latin1_swedish_ci"
string(17) "latin1_swedish_ci"

Fatal error: Call to undefined method mysqli::character_set_name() in C:\usr\mysqli\a.php on line 9


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-18 12:02 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC