Re: Struggling with MySQL query
| From: | David Green | Date: | Tue, 09 Aug 2011 20:03:55 +0000 |
| Subject: | Re: Struggling with MySQL query | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314453@lists.php.net to get a copy of this message | ||
Thank you all for the various suggestions.
It now works with this:
$find = strip_tags($find);
$find = trim($find);
$data = mysql_query("SELECT * FROM news_items WHERE headline LIKE
'%$find%'");
Another "newb" question: does strip_tags() help at all in preventing SQL
injection attacks?
Kind regards
David