lox / pheasant

A lightweight data mapper designed to take advantage of PHP 5.3+
http://getpheasant.com
MIT License
101 stars 21 forks source link

Automatic IN binding broken? #86

Closed Jud closed 11 years ago

Jud commented 11 years ago

DomainObject::find('id IN ?', array(1234, 123, 456)); throws a Mysql error:

Fatal error: Uncaught exception 'Klein\Exceptions\UnhandledException' with message 'exception 'Pheasant\Database\Mysqli\Exception' with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Array'))' at line 1'
lox commented 11 years ago

Working on a fix.

lox commented 11 years ago

Interesting, my plan was for people to use id=? and the binder infers whether it's an = or an IN operator. That will work as-is, but I'd like to support the syntax you suggest.

lox commented 11 years ago

Support added in 9396f89f71. Let me know if this doesn't fix the problem.