mrcrypster/mysqly

Warning when using "Fetch - order by" without where-clause

Closed this issue · 2 comments

When I use
$rows = mysqly::fetch( 'users', [ 'order_by' => 'age DESC' ] );
I get two warnings:
Warning: Undefined variable $where in mysqly.php on line 148
Warning: Undefined variable $bind in mysqly.php on line 161

Possible fix:
line 148:
Current: if ( $where ) {
Fix: if ( !empty($where) ) {

line 161:
Current: return static::exec($sql, $bind);
Fix: return static::exec($sql, $bind??[]);

This should fix it:
3f32c9d