Modifying a query so that one field must contain a variable

veebee werd

New Member
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 \[code\]s.title\[/code\] has the variable \[code\]$find\[/code\] somewhere in it. I. e., the field \[code\]s.title\[/code\]. doesn't have to exactly equal \[code\]$find\[/code\], but it must have a word in it that equals \[code\]$find\[/code\].How can I do this?Thanks in advance,John\[code\]$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_recentFROM submission sINNER JOIN login l ON s.loginid = l.loginidLEFT OUTER JOIN comment c ON s.submissionid = c.submissionidGROUP BY s.submissionidORDER BY most_recent DESCLIMIT $offset, $rowsperpage";\[/code\]
 
Back
Top