Question

I am having problems in finding anything like this in the Idiorm documentation. I am trying to do a case sensitive search something like :

$article=ORM::for_table('articles')->where_like('content','%fOo%')->find_many();

But i want the search to be case sensitive, what do i need to configure ?

LE: Here is how the table is defined:

ORM::get_db()->exec( 'DROP TABLE IF EXISTS pw_article' );
     ORM::get_db()->exec(
    'CREATE TABLE pw_article(' .
    'art_id INTEGER PRIMARY KEY AUTOINCREMENT, ' .
    'art_title TEXT, ' .
    'art_content TEXT, ' .
    'art_views INTEGER, ' .
    'art_publish_date DATETIME, ' .
    'art_update_date DATETIME, ' .
    'art_author INTEGER, ' .
    'FOREIGN KEY (art_author) REFERENCES pw_user (usr_id))'
);
Was it helpful?

Solution

The LIKE operator always use case-insensitive comparisons. (The column's collation does not affect this.)

To make such comparison case sensitive, either

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top