I have a site up and the search feature was very basic and always has done what it needs to do.
I now want to incorperate a value from another table into the search which gets a bit tricky.
I want to return a complete set of results from one query, but the new info only relates (via id) the the data in the other table which I want to return.
I currently have
SELECT *
FROM [TABLE]
WHERE ( LOWER(title) LIKE '%$search%'
OR LOWER(contents) LIKE '%$search%'
)
AND type = 'product'
in the other table there is a col called id (same as the other which are related) and another meta_value.
I want to not only do the operation above but also search the meta_value data, if a match get the results from the other table (using the id).
If any one understands what I am saying and it is possible then I would be muchly appreciated if you could push me in the right direction.
You can join the two tables using their IDs using the LEFT JOIN command. You can then filter on columns in either table.