ID: 48293 Updated by: ka...@php.net Reported By: aaa_whoknows_me at list dot ru -Status: Open +Status: Closed Bug Type: MySQL related Operating System: Windows PHP Version: 5.3.0RC2 New Comment:
Marked as closed. As for the PDO question; it does not seems like PDO offers that ability as the separate drivers does. Previous Comments: ------------------------------------------------------------------------ [2009-06-02 13:23:31] aaa_whoknows_me at list dot ru >$conn = mysqli_init(); >$conn->options(MYSQLI_SET_CHARSET_NAME, "utf8"); >$conn->real_connect($db_host,$db_user,$db_pass,$db_name); How can I do the same actions with PDO? $pdo = new PDO( 'mysql:host=hostname;dbname=defaultDbName', 'username', 'password', $options ); What options should I use to do the same thing as with mysqli? ------------------------------------------------------------------------ [2009-05-21 13:43:55] aaa_whoknows_me at list dot ru Thank you very much! It seems to work! ------------------------------------------------------------------------ [2009-05-21 11:48:02] carsten_sttgt at gmx dot de > $conn = new mysqli(); // no params, no connection $conn = mysqli_init(); > $conn->connect("host", "user", "pass"...); $conn->real_connect("host", "user", "pass"...); Regards, Carsten ------------------------------------------------------------------------ [2009-05-21 10:20:38] aaa_whoknows_me at list dot ru Oh, and the most important thing: this code >$conn->options(MYSQLI_SET_CHARSET_NAME, "utf8"); raises an error Couldn't fetch mysqli. It happens with any charset. ------------------------------------------------------------------------ [2009-05-21 10:12:42] aaa_whoknows_me at list dot ru >$conn = new mysqli(); // no params, no connection >$conn->options(MYSQLI_SET_CHARSET_NAME, "yourcharset"); >$conn->connect("host", "user", "pass"...); Unfortunatly, it didn't help. I tried to use utf8, utf-8, ucs2, utf16, utf-16 and I sent username in all these charsets in all possible combinations but it didn't work anyway. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/48293 -- Edit this bug report at http://bugs.php.net/?id=48293&edit=1