I have tried all kinds of things and spent hours doing this and would really like it if someone can tell me what I'm doing.
This is my SQL query:
SELECT * FROM txp_file WHERE filename LIKE '%Fast®%' OR description LIKE '%Fast®%'
In phpmyadmin, this brings back the results I want. On the page, the query apparently works but gets no result. I have tried to use substring to omit the special trademark symbol, I have tried a million different variations but I get no result. Here is my php code:
$sql = "SELECT * FROM txp_file WHERE filename LIKE '%$querytitle%' OR description LIKE '%$querytitle%'";
$query = mysql_query($sql) or die(mysql_error());
$result = mysql_fetch_array($query);
if ($result){
echo "<a href='#'>$querytitle</a>";
}
else
echo 'nil';
The connection to the database is already there so I don't need to do it again in this case. Can anyone find anything wrong with this code?
P.S. $querytitle is a global variable. I have echoed it and it comes up just the way it should.