I am trying to retrieve data from a database and i need to run the sql as a raw query, this is how I do it:
$var = Nuti::select(DB::raw("select name, image, info from nuti
where name like '%:search_term%'"), array("search_term" => $term));
return $var;
$var returns an empty array but when I try to run the same query directly in a mysql console, it returns two records.
[EDIT]
I just shortened the query when i posted this question, the need for a raw query is to do something more like this:
$var = Nuti::select(DB::raw("select name, image, info from nuti
where name like '%:search_term%'") or info %like% '%:search_term%', array("search_term" => $term));
return $var;