我想实现不区分大小写的搜索
/*get the title to search*/
$newsTitle=Input::get('srach_newsTitle')?Input::get('srach_newsTitle'):'';
$query = DB::table('news');
if( strlen($newsTitle) )
{
$query->whereRaw('LOWERCASE(`newsTitle`) LIKE ? ',[trim(strtolower($newsTitle)).'%']);
}
but its says function LOWERCASE is not Defined in My projects following is the error message
QueryException in Connection.php line 729:
SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION cpr-laravel.LOWERCASE does not exist (SQL: select count(*) as aggregate from news
where LOWERCASE(newsTitle
) LIKE test%)
whats wrong i am doing?plz help