Struggling with MySQL query

From: Date: Tue, 09 Aug 2011 14:14:05 +0000
Subject: Struggling with MySQL query
Groups: php.general 
Request: Send a blank email to php-general+get-314444@lists.php.net to get a copy of this message
Hi I have a simple from which uses the post method to get to my page script results.php in results.php I have $find=$_POST["find"]; //this works perfectly, echo $find gives me the search term as entered I then connect to mysql and select the db successfully. After that, I have the following: $find = strtoupper($find); $find = strip_tags($find); $find = trim($find); $data = mysql_query("SELECT * FROM news_items WHERE upper('headline') LIKE '%$find%'"); while($result = mysql_fetch_array($data)) { //etc I get no error messages, but no results to work with either. It returns a "no results" message that I put in further on in the script. A casual look at the db shows that I should be getting results. I'm pretty sure that the problem is in the query, but for the life of me I can't see the problem. Kind regards David

« previous php.general (#314444) next »