The problem i am having is, It is givng me the error:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Desc) LIKE'%TEST%'' at line 1
And i have no idea why. Mainly i want the user to be able to enter a space like 'testing this' and it find testing in description field and this in say a different discription but not requiring testing in it also. I guess if it was so simple i wouldnt need help xD. Ive sat here looking for over 4 hours trying to figure this out, Downloading different scripts (I.E: Tsep) And trying to read the code and understand basically what it is doing. And i truthfully have no idea what the [bleep] they are doing.
Below is my code:
<? include "Sql/Sql.php"; //This file we will use to search with. The searching is quite simple but very effective. print "<center>Search:<BR><BR><form method=post action=index.php?Page=Search><input type=text name=sear size=10><input type=submit name=go value=Search></form></center>"; $search = $_POST['sear']; $go = $_POST['go']; if ($go == Search) { $find = $search; $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); $data = mysql_query("SELECT * FROM M_STerms WHERE (Desc) LIKE'%$find%'") or die (mysql_error()); while($result = mysql_fetch_array( $data )) { print "<A href='index.php?Page=$result[Page]'><b>$result[Name]</b></a> $result[Desc]<br><BR>"; } $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query<br><br>"; } //And we remind them what they searched for echo "<b>Searched For:</b> " .$find; } ?>