Download the PHP package noahheck/e_mysqli without Composer
On this page you can find all versions of the php package noahheck/e_mysqli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download noahheck/e_mysqli
More information about noahheck/e_mysqli
Files in noahheck/e_mysqli
Package e_mysqli
Short Description Replacement for default Mysqli class to allow viewing a parameterized query with the arguments inserted into the string
License Apache-2.0
Homepage https://github.com/noahheck/E_mysqli
Informations about the package e_mysqli
E_mysqli
Replacement for default Mysqli class to allow viewing a parameterized query with the arguments inserted into the string
View the changelog
Usage
Provides similar functionality to that found in the PDO sister project:
Not being able to view a complete version of the query to be executed on the server after statement parameters have been interpolated can be frustrating.
EMysqli aims to ease this burden by providing developers the ability to view what would be an example of the query executed on the server:
The result of this will be:
When used correctly, the interpolated values are escaped appropriately according to character set in use on the database server:
It's also possible to view the interpolated query string without executing the query:
Further Enhancements
A (fortunate ?) side effect of the way EMysqli performs it's work also allows you to bind multiple parameters individually, helpful if your query string is generated in separate method/function calls.
This is accomplished by binding the parameters individually:
Note
Using either of these two methods stores the bound parameters as references to their runtime variables preventing the need to rebind parameters, which is the default method for handling bound parameters in mysqli:
Installation
Install via composer:
Configuration
__E_mysqli__ extends both the mysqli
and mysqli_stmt
classes. Your mysqli
object creation process will simply need to be updated to generate an instance of EMysqli\EMysqli
instead:
That's all there is to it. Your $mysqli
object should function the same as it has.
Feedback Request
The E_PDOStatement project has received some good feedback, and a common request was to offer the same or similar functionality to users still using mysqli. Though I have no practical experience using the myslqi
extension, I have researched how this might be possible and this is what I have managed to come up with.
As I have no production quality application code to test this extension on, any feedback regarding performance in a production setting would be appreciated. Bugs, new feature requests and pull requests are of course welcome.