Hi guys,
My queries worked just fine on Postgres, but now that I've moved to
dreamhost (MySQL), they don't return any results. Here's my code:
imgsearch=set(list(Searchtable.select(
OR(Searchtable.q.galleryterms.contains(term),
Searchtable.q.imageterms.contains(term)))))
I've also tried this:
imgsearch=set(list(Searchtable.select("""Searchtable.galleryterms LIKE
term OR Searchtable.imageterms LIKE term""")))
but with that one, it doesn't recognize "term" as the variable that it
is.
Any suggestions on a better way to construct this query, or mangle/add
to "term" so that results get returned? In playing with phpMyAdmin, I
realized that % wildcards are necessary for a successful query, but
changing term with the following line still doesn't return results:
term = '%'+term+'%'
I have verified that records are in the database with phpMyAdmin, and
that they match the criteria I'm looking for, I just think I'm not
using the right code to query/select.
Thanks,
Mike