creatoro / jelly

A flexible ORM for Kohana 3.1+
http://jelly.jonathan-geiger.com
MIT License
72 stars 13 forks source link

Can't use functions like UPPER in where clause #86

Closed xtazz closed 13 years ago

xtazz commented 13 years ago

Queries like this: Jelly::query('table')->...->where('UPPER(table.field_name)','IN',$field_values) are resulting in following SQL code: ...WHEREUPPER(table.field_name)IN ('VALUE1', 'VALUE2')

This code is causing MySQL to fail query because ` are incorrectly placed for such where clauses.

If it's Kohana issue, please let me know, I'll resubmit this bug to them.

Thanks!

Best Regards, Peter

leth commented 13 years ago

Try using a DatabaseExpression object. Look up the kohana docs for DB:expr(...).

xtazz commented 13 years ago

Thanks much! Now it works okay