Re: set_sql and like '%$searchTerm%'
[prev]
[thread]
[next]
[Date index for 2004/09/15]
On Tue, 2004-09-14 at 16:03, Michael Jensen wrote:
> Table::Files->set_sql(full2a_srch => qq|select f.* from files f, texts
> t where (f.user_id=$filesUserID AND f.id=t.file_id AND (f.file like
> "%$searchTerm%" OR t.line_1 like "%$searchTerm%" OR t.line_2 like
> "%$searchTerm%" OR t.line_3 like "%$searchTerm%" OR t.body like
> "%$searchTerm%")) order by create_date desc limit $p,$limit|);
>
> my @list2aQuery = Table::Files->search_full2a_srch();
This doesn't look like it should work at all. The set_sql call happens
at compile time, when $searchTerm probably has no value. You are
supposed to do this kind of thing with placeholders, and pass the value
in when you call search_full2a_srch().
- Perrin
|
|
Re: set_sql and like '%$searchTerm%'
Perrin Harkins 15:25 on 15 Sep 2004
|