Struggling with MySQL query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux