ezSQL / ezsql

PHP class to make interacting with a database ridiculusly easy
http://ezsql.github.io/ezsql
GNU Lesser General Public License v3.0
866 stars 291 forks source link

Fix query prepared empty array #191

Closed maltrana closed 3 years ago

maltrana commented 4 years ago

When we send a prepared_query with an empty array we get an error.

issue #190

To Reproduce $db->query_prepared( 'select id from table' , []);

Expected behavior Return result without errors

Environment: EZSQL Version : 4.0.10 PHP Version: 7.3 SQL Driver: mysql

Changes:

codecov-commenter commented 4 years ago

Codecov Report

Merging #191 into master will increase coverage by 0.00%. The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #191   +/-   ##
=========================================
  Coverage     85.04%   85.05%           
- Complexity      809      811    +2     
=========================================
  Files            14       14           
  Lines          2033     2034    +1     
=========================================
+ Hits           1729     1730    +1     
  Misses          304      304           
Impacted Files Coverage Δ Complexity Δ
lib/Database/ez_mysqli.php 95.09% <93.75%> (+0.02%) 86.00 <0.00> (+2.00)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c843017...74e4b18. Read the comment docs.

TheTechsTech commented 4 years ago

What's up with the spacing? Not PSR-2 in ez_mysqi.php modification.

maltrana commented 4 years ago

I'm sorry

Corrected.

TheTechsTech commented 3 years ago

The reason this PR hasn't been merged, is it's missing the remaining the other vendor SQL driver changes, and the other changes needed in other methods that call query_prepared, which is already making the check you have implemented.

Your PR is just for mysql, where this whole package is not focused on any one vendor,

It's an interchangeable abstraction implementation. Elsewhere, I have indicate that query_prepared is really private made public for others to create the use cases without using the shortcut methods.

You can resubmit against branch v5 on any reopen/update.