Hello,
The query below works well. I would like to use it for search results now. I would like to have it return the same results with this one modification:
The field s.title
has the variable $find
somewhere in it. I. e., the field s.title
. doesn't have to exactly equal $find
, but it must have a word in it that equals $find
.
How can I do this?
Thanks in advance,
John
$sqlStr = "SELECT s.loginid, s.title, s.url, s.displayurl, s.datesubmitted, l.username,
s.submissionid, COUNT(c.commentid) countComments,
GREATEST(s.datesubmitted, COALESCE(MAX(c.datecommented), s.datesubmitted)) AS most_recent
FROM submission s
INNER JOIN login l ON s.loginid = l.loginid
LEFT OUTER JOIN comment c ON s.submissionid = c.submissionid
GROUP BY s.submissionid
ORDER BY most_recent DESC
LIMIT $offset, $rowsperpage";