catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

rowCount() always return NULL ? #736

Closed ghost closed 6 years ago

ghost commented 6 years ago

Strange behaviour... tested on version 1.5.4 - 1.5.5 - 1.5.6 & php 5.6 / 7.1:

_Warning: Invalid argument supplied for foreach() in \path_tolibraries\medoo\src\Medoo.php on line 319

i even test with $medo->query()... same result.

I dont want to make 2 queries (1 select and 1 for the update) just to see if id=1 returned me a valid result or not before making an update... Any help is more than welcome !

ghost commented 6 years ago

Damn ! i was linking why to wrong handler....

$row = $medoo->update("...");
$medoo->rowCount();

the error : $medoo->rowCount() should be $row->rowCount() instead...