victorwesterlund / php-libmysqldriver Goto Github PK
View Code? Open in Web Editor NEWPHP abstraction library for common MySQL/MariaDB statements for use with php-mysqli
License: GNU General Public License v3.0
PHP abstraction library for common MySQL/MariaDB statements for use with php-mysqli
License: GNU General Public License v3.0
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') LIMIT 1' at line 1
This is caused by run_query()
only checking if the value for $param is null
, not if it's empty.
"SELECT NULL FROM <table> WHERE () LIMIT 1"
PHP 8.1 introduced a new method execute_query()
which abstracts prepared statemend binding and execution. It should definitely be used instead of the custom-made implementation in this library.
Release 3.1.1 introduced a bug when passing null
to select()
(I really need to sort of CI testing..)
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated
I'm considering making the MySQL->flatten()
method also run MySQL->limit(1)
since it has the same effect.
Example:
// Flatten returned array to first entity if set
public function flatten(bool $flag = true): self {
$this->flatten = $flag;
// Set LIMIT 1 if flatten flag is enabled, or unset if turned off
$this->limit($this->flatten ? 1 : null);
return $this;
}
I'm not sure tho if this could have other unwanted side-effects when for example removing the flatten flag with flatten(false)
. LIMIT
would still be 1
. Or if we simply remove the LIMIT
all together, any LIMIT set before this will be forgotten and wiped and I'm not sure either if it's worth storing the last LIMIT in an instanced property.. It might be overkill.
Add further abstraction methods for SELECT
, INSERT
, and UPDATE
.
Right now it's pretty annoying to dynamically filter a statement.
The PHP sources in this repo have an insane mix of tab- and space indented blocks. VScode handles it well, but look awful on GitHub.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.