March 30th, 2004, 07:58 PM
Multi tier/field search
Ok what im tring to do here is build a complex search for a forums database. Basically before you can post your required to select a year, make and model of car. Then you select a Vehicle system, Main Category, Subcategorey and Subcategory1. Then you are allowed to make a post. I am running a MS Access database with a OBDC driver through Cold Fusion Server.
What is going to happen is once the post has been written before it displays your message back to you it will search the database for simalar entries. Where I think it gets tricky is that it cant match everything 100% if you know what i mean, and what i would like is a percentage or nuber of fields to be displayed. So it would say (5 out of 7 fields matched or 70% match) and display those results in a list. Now I have got the database up and can post with the year make model etc. but cant figure out this search, all i have been able to acomplish is a search with 100% results where if one thing doesnt match nothing shows up.
March 30th, 2004, 11:20 PM
Try using OR in your WHERE clause, instead of AND to get results that have any or all of the criteria. And look into using COUNT() in the SELECT clause (and a GROUP BY clause at the end) to get a count of records returned. And I'd advise grabbing a good book on SQL because problems like this will confront you again and again, and the only real solution is a firm grasp of SQL.
March 31st, 2004, 01:10 AM