php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68923 Missed possible option at mysqli::options
Submitted: 2015-01-27 19:04 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sveta at microbecal dot com Assigned:
Status: Open Package: MySQL related
PHP Version: 5.5.21 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sveta at microbecal dot com
New email:
PHP Version: OS:

 

 [2015-01-27 19:04 UTC] sveta at microbecal dot com
Description:
------------
It is possible to set character set for PHP script before mysqli_connect, but http://php.net/manual/en/mysqli.options.php does not say anything about it. It lists, instead, MYSQLI_READ_DEFAULT_FILE and MYSQLI_READ_DEFAULT_GROUP which have no effect if mysqlnd used.

Originally reported at http://bugs.mysql.com/bug.php?id=75466

Test script:
---------------
$ php -m | grep mysql
mysql
mysqli
mysqlnd
pdo_mysql

$ php -r '$m=mysqli_init(); $m->options(MYSQLI_READ_DEFAULT_FILE, "/Users/sveta/.my.cnf"); $m->options(MYSQLI_READ_DEFAULT_GROUP, "client"); $m->connect("127.0.0.1","root","f"); '

Warning: mysqli::connect(): (HY000/1045): \0414\043E\0441\0442\0443\043F \0437\0430\043A\0440\044B\0442 \0434\043B\044F \043F\043E\043B\044C\0437\043E\0432\0430\0442\0435\043B\044F 'root'@'localhost' (\0431\044B\043B \0438\0441\043F\043E\043B\044C\0437\043E\0432\0430\043D \043F\0430\0440\043E\043B\044C: \0414\0410) in Command line code on line 1


$ php -r '$m=mysqli_init(); $m->options(MYSQLI_SET_CHARSET_NAME, "utf8"); $m->connect("127.0.0.1","root","f");'

Warning: mysqli::connect(): (HY000/1045): Доступ закрыт для пользователя 'root'@'localhost' (был использован пароль: ДА) in Command line code on line 1
Svetas-MacBook-Pro:mysql-git sveta$ php -r '$m=mysqli_init(); $m->connect("127.0.0.1","root","f");'



Expected result:
----------------
I expect either full list of options which can be specified for mysqli::options or link to MySQL documentation with full list. But in latter case all options which are not supported by PHP extension should be noted at http://php.net/manual/en/mysqli.options.php

Actual result:
--------------
See "test script" part.

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 17:01:27 2019 UTC