I have a large database and its getting to big to find relevant stuff quickly.
I would like the following: search by customer type of function search. (We are a printing company) eg. search Business Cards you get thousands of results from all customers and to hard to find the most recent from a customer.
I'm using LIKE and its pretty good, but for a particular customer they have several names very similar and its bringing up all variations of that customer.
I've tried a few things but nothing is working so far. I have tried SELECT * FROM Jobs WHERE Customer='Customer' but I still get other customers.
Best result would be a select customer from a dropdown the a search. but I can implement custom search for each customer if required.
current query is:
$raw_results = mysql_query("SELECT * FROM Jobs WHERE (`id` LIKE '%".$query."%') OR (`Customer` LIKE 'CUSTOMER NAME') OR (`OrderNumber` LIKE '%".$query."%') OR (`JobDescription` LIKE '%".$query."%') OR (`JobNotes` LIKE '%".$query."%') OR (`Item_1_Name` LIKE '%".$query."%')OR (`Item_2_Name` LIKE '%".$query."%')OR (`Item_3_Name` LIKE '%".$query."%') OR (`Item_4_Name` LIKE '%".$query."%') OR (`Item_5_Name` LIKE '%".$query."%') OR (`Item_6_Name` LIKE '%".$query."%') OR (`Item_7_Name` LIKE '%".$query."%') OR (`Item_8_Name` LIKE '%".$query."%') OR (`Item_9_Name` LIKE '%".$query."%') OR (`Item_10_Name` LIKE '%".$query."%')ORDER BY id DESC") or die(mysql_error());