First off I am a bit of a PHP / MySQL novice, so please go gentle!
I'm creating a site for my friends business with motorcycle part diagrams and part numbers so they can look up items without going through manuals etc.
I want to add a part number search facility so that they can find any motorcycles that list this part as well.
So far I have used a open-source script to get the search part working, however when I enter a part number, it displays all of the pages it has indexed.
MySQL has one table (called websites) with three columns - URL, title & description...
URL: Website link to the page
Title: Title of the page
Description: A list of part numbers used within this page
Title: Page 1
Description: 12345, 67890, 09876, 54321
This is the query that I am firing at the database when a part number is entered into the search box.
$result=mysql_query("SELECT * FROM websites WHERE `title` LIKE '%$Number%' OR `url` LIKE '%$Number%' OR `description` LIKE '%$Number%' ");
while ($results = mysql_fetch_array($result))
echo "<ul><li><a href='$url'>$title</a></li></ul><br>";
Is there a way I can make it look for exact matches within the description and only show them in the results, instead of all of the pages?