-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About mysqli options MYSQLI_OPT_INT_AND_FLOAT_NATIVE #1979
Comments
There are a number of users in China who have no problem accessing the forum from there, and I have done so myself. I don't know enough to answer your question, but it is definitely something for the forum, as we use github for bug tracking and planned work.
ps - I was unable to access google from China, but most sites, including our forum, were not blocked.
Jim Parry
Faculty, Computer Systems
Project Lead, CodeIgniter<https://codeigniter.com>
…________________________________
From: Haibin <notifications@github.com>
Sent: Wednesday, May 1, 2019 8:02 PM
To: codeigniter4/CodeIgniter4
Cc: Subscribed
Subject: [codeigniter4/CodeIgniter4] About mysqli options MYSQLI_OPT_INT_AND_FLOAT_NATIVE (#1979)
I am sorry to post the question here. I can't open the forum, I think because the Chinese network has blocked some websites, such as google. I have no time to configure a vpn recently.
Describe the bug
I have a problem, MySQL query results need to return integer and float, but mysql 5.7 defaults to return integer and float as a string type. So I need to use a configuration, MYSQLI_OPT_INT_AND_FLOAT_NATIVE. In CodeIgniter 3, I can do this:
$db->conn_id->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE);
But CodeIgniter 4, this method is no longer useful.
$db->connID->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE);
This doesn't work either.
I want to know, there is any good way to use mysqli's options directly, without changing the framework source.
In addition, regarding MYSQLI_OPT_INT_AND_FLOAT_NATIVE, can you consider making a configurable item and implementing it directly in the Mysqli driver.
CodeIgniter 4 version
CodeIgniter 4.0.0 beta.2
Context
* OS: Mac OS 10.14.4
* Web server [Nginx 1.13.2]
* PHP version [7.2.14]
-
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#1979>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAYOG33NB7DLRSQWC7TZE3DPTJKSXANCNFSM4HJ3CWNQ>.
|
The forum can be accessed, but the account cannot be registered. If I am not mistaken, the forum registration uses the google verification code. Although it is not a big problem, it still takes a certain amount of work to overturn the wall. China's network Great Wall is a helpless and sad system. |
The google captcha was removed some time ago.
Jim Parry
Faculty, Computer Systems
Project Lead, CodeIgniter<https://codeigniter.com>
…________________________________
From: Haibin <notifications@github.com>
Sent: Wednesday, May 1, 2019 10:10 PM
To: codeigniter4/CodeIgniter4
Cc: James Parry; Comment
Subject: Re: [codeigniter4/CodeIgniter4] About mysqli options MYSQLI_OPT_INT_AND_FLOAT_NATIVE (#1979)
There are a number of users in China who have no problem accessing the forum from there, and I have done so myself. I don't know enough to answer your question, but it is definitely something for the forum, as we use github for bug tracking and planned work. ps - I was unable to access google from China, but most sites, including our forum, were not blocked. Jim Parry Faculty, Computer Systems Project Lead, CodeIgniterhttps://codeigniter.com
...
The forum can be accessed, but the account cannot be registered. If I am not mistaken, the forum registration uses the google verification code. Although it is not a big problem, it still takes a certain amount of work to overturn the wall. China's network Great Wall is a helpless and sad system.
-
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#1979 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAYOG32DVRAQT5MU5ZZJ6R3PTJZV3ANCNFSM4HJ3CWNQ>.
|
I know is not a place to write about it, but... |
Maybe the google captcha hasn't been removed yet.... |
Will investigate, thanks!
Jim Parry
Faculty, Computer Systems
Project Lead, CodeIgniter<https://codeigniter.com>
…________________________________
From: Haibin <notifications@github.com>
Sent: Thursday, May 2, 2019 6:54 AM
To: codeigniter4/CodeIgniter4
Cc: James Parry; Comment
Subject: Re: [codeigniter4/CodeIgniter4] About mysqli options MYSQLI_OPT_INT_AND_FLOAT_NATIVE (#1979)
The google captcha was removed some time ago. Jim Parry Faculty, Computer Systems Project Lead, CodeIgniterhttps://codeigniter.com
...
Maybe the google captcha hasn't been removed yet....
[1556802688333]<https://user-images.githubusercontent.com/25802553/57077574-fba74280-6d1e-11e9-9f22-1af774d26f69.jpg>
[1556802693129]<https://user-images.githubusercontent.com/25802553/57077591-0661d780-6d1f-11e9-9e2b-14a0208bdfc4.jpg>
[1556802706169]<https://user-images.githubusercontent.com/25802553/57077599-0a8df500-6d1f-11e9-98be-37e8b45170b4.jpg>
-
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#1979 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAYOG3ZWDWF5UXF6RNMB2I3PTLXAXANCNFSM4HJ3CWNQ>.
|
Thanks for your suggestion, I extended the model. To use mysqli options, I need a real connection connID, but the connID will only exist when the query is actually connected to the database. So I had to use $db->initialize() first in the constructor of the model, then execute options(); I don't know is this will affect the efficiency of the on-demand connection. it's ok, thank you, and thanks jim parry again~. |
I used this stackoverflow answer and it works : |
See #7265 |
I am sorry to post the question here. I can't open the forum, I think because the Chinese network has blocked some websites, such as google. I have no time to configure a vpn recently.
Describe the bug
I have a problem, MySQL query results need to return integer and float, but mysql 5.7 defaults to return integer and float as a string type. So I need to use a configuration, MYSQLI_OPT_INT_AND_FLOAT_NATIVE. In CodeIgniter 3, I can do this:
$db->conn_id->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE);
But CodeIgniter 4, this method is no longer useful.
$db->connID->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE);
This doesn't work either.
I want to know, there is any good way to use mysqli's options directly, without changing the framework source.
In addition, regarding MYSQLI_OPT_INT_AND_FLOAT_NATIVE, can you consider making a configurable item and implementing it directly in the Mysqli driver.
CodeIgniter 4 version
CodeIgniter 4.0.0 beta.2
Context
The text was updated successfully, but these errors were encountered: