searching 2 tables
Hey Jason
How would I go about setting my search to search 2 (or more) tables rather than just the 1 as part of the wizard?
Cheers
Jamie
Hey Jason
How would I go about setting my search to search 2 (or more) tables rather than just the 1 as part of the wizard?
Cheers
Jamie
Create a joined query on the results page to retun data from the linmked tables:
http://www.w3schools.com/sql/sql_join.asp
Hey Jason
Following on from our conversatrion yesterday, I have managed to get the results page working (with the add to cart functionality) and filtering... in the main.
I am now trying to get the search results to also filter out products that may be members of a category that has been hidden.
I am pretty sure I need to add to the inner join (?) I already have but my efforts arent working. I have added the results.php file and 2 screenshots of the 2 different tables in the database in th PM section.
Cheers
J
when you say "but my efforts arent working" can you provide more details please.
in what way is it not working?
What _does_ it do?
how does this differ from what you expect it to do?
also a link where I can see the problem, and a detailed explanation of what I am looking for.
OK, I changed the recordset to be
$query_Products = "SELECT products.*, productcategories.CategoryName, productcategories.Live FROM products INNER JOIN productcategories ON products.ProductCategoryID = productcategories.CategoryID"
I wasnt sure what or how to add the further refernce to the 'Live' column from productcategories.
Then I wrapped the results in a show if based on Live=1 (from productcategories) but when I did a search no results showed at all.
If you go to http://hairmekanix.co.uk/sections.php
search Travel - this is a category which is hidden in the database but has a product associated with it. The product itself is set to live.
What I am trying to get it to do is to hide products even if they are 'live' if the category is set to hidden.
Cheers
Jamie
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.