catfan / Medoo

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

1.4 exec() - missing $map #565

Closed turbopixel closed 7 years ago

turbopixel commented 7 years ago

We use ´exec()` in our system. Now the method is exploding, because $map is not set. I think a default value is missing

2017/05/11 13:46:51 [error] 26062#26062: *19052 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function Medoo\Medoo::exec(), 1 passed in /var/www/....

catfan commented 7 years ago

In fact, exec() is an undocumented API for special usage. The old version is exec() is a short cut for PDO::exec, but for the 1.4, exec() is PDOStatement::execute for prepared statement. It will be different result.

It's OK for me to make it work again without $map parameter. I will fix for it soon. But for correct exec() call like old version, you may use $database->pdo->exec() instead.

catfan commented 7 years ago

b5f9f60

turbopixel commented 7 years ago

Thanks! $database->pdo->exec() is a good compromise for both, I think.