-
Notifications
You must be signed in to change notification settings - Fork 4.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
Improved DBMySQLi::query #991
Conversation
What specifically is improved? Also the coding style is way off what OpenCart uses (Yoda conditions!). |
Uhm, sorry about the style: I am new to OpenCart and couldn't find a style guide straight away. The function is improved in that it properly uses mysqli::fetch_all (don't really need the loop) and it uses the result for error checking avoiding nested if's. At least that is my reasoning behind the pull request. |
It would have helped to look at how all the other database drivers are structured. |
Well, I get it and I am sorry, but I only made the request: it could have been rejected. Pull requests are supposed to be reviewed, or am I wrong? |
Who knows. The project's github management is not consistent. |
OK, I have been thinking about how to reply to this, because participating in open source projects always results in this kind of problems. Since I still think that my approach is better because it uses the API more consistently (there is an API function to do exactly what the for loop does, and the return value of the query should be checked before checking for errors, although the latter would be set only on failure in this particular case) there are two solutions that I see feasible:
|
I get this: Fatal error: Call to undefined method mysqli_result::fetch_all() My host's php does not include mysqlnd - a native driver, so mysqli::fetch_all() is not available |
This was already resolved. Please use the latest version. |
Improved the function: