Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: JayRoe - toukokuu 03, 2008, 01:20:23 IP

Otsikko: Select * where "[review]" in subject
Kirjoitti: JayRoe - toukokuu 03, 2008, 01:20:23 IP
As the title suggests. How do I phrase this correctly?

$result = mysql_query('SELECT id_topic, id_board, poster_time, poster_name, subject FROM smf_messages
WHERE id_board IN (' . $use_boards .')
AND "[review]" IN (subject)
');


Basically what I want to do is, find posts that have "[review]" in the subject, without the quotation marks. It works if the subject is "[review]", but if I change the subject to "[review]this game", it stops working.
Otsikko: Re: Select * where "[review]" in subject
Kirjoitti: rsw686 - toukokuu 03, 2008, 03:11:49 IP
SELECT id_topic, id_board, poster_time, poster_name, subject
FROM smf_messages
WHERE id_board IN (' . $use_boards .')
AND subject LIKE '%[review]%'
Otsikko: Re: Select * where "[review]" in subject
Kirjoitti: JayRoe - toukokuu 03, 2008, 06:42:38 IP
Thank you, that did it.  :)