fluentpdo icon indicating copy to clipboard operation
fluentpdo copied to clipboard

leftJoin with parameters not work!

Open CrazyPHP opened this issue 5 years ago • 0 comments

Try something like this: $query->leftJoin('order_geo ON (order_geo.order_id = order_visit.id AND order_geo.order_type = :order_type)', [':order_type'=>'visit']);

and you will get error: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in ...

becouse parameter was saved in $parameters in wrong way: array(4) { [0]=> array(1) { [":order_type"]=> string(5) "visit" } [":status"]=> string(2) "on" }

Fluentpdo save it as additional inner array, instead of saving the parameter simply as an element of the array.

CrazyPHP avatar Jun 20 '19 05:06 CrazyPHP