Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lowercase comparisons #7

Closed
hexa2k9 opened this issue Nov 2, 2010 · 2 comments
Closed

lowercase comparisons #7

hexa2k9 opened this issue Nov 2, 2010 · 2 comments

Comments

@hexa2k9
Copy link

hexa2k9 commented Nov 2, 2010

On MySQL the following Query is possible:
SELECT * FROM table WHERE LOWER(field) = 'stringtomatch';

I personally use that A LOT on some webapps .. is there a way for this kind of comparison on idiorm as well? ->select('LOWER(field)', 'stringtomatch') isn't working for me.

The same is for other things like transforming a datetime to a timestamp using UNIX_TIMESTAMP(field).

@j4mie
Copy link
Owner

j4mie commented Nov 3, 2010

Hi,

This is a perfect use case for the where_raw method:

ORM::for_table('table')
    ->where_raw('LOWER(field) = ?', 'stringtomatch')
    ->find_many();

@j4mie
Copy link
Owner

j4mie commented Nov 3, 2010

Oops, forgot to close

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants