Hi there, I have a website built on wordpress. I am using a custom field to query my database for product information.
As my custom field query changes on every page I would like to be able to combine 2 custom fields to make the 'final' query. I would like to have a master custom field that would ideally be held in an include file. Then a second custom field would be used to populate the variable data within the master.
## Deliverables
Here is the example custom field I am currently using:
select p.*, m.*, d.* from datafeeds as d, products as p left outer join meta as m on [login to view URL] = [login to view URL] where p.datafeed_id = [login to view URL] and ((match([login to view URL]) against ('+brief' in boolean mode)) and (match([login to view URL]) against ('+lepel +bikini' in boolean mode)) or ((match([login to view URL]) against ('+lepel' in boolean mode)) and [login to view URL] like '%bikini%' or (match([login to view URL]) against ('+bikini' in boolean mode)) and [login to view URL] like '%lepel%')) order by p.display_price asc limit 2000
Where the word "lepel" is the variable that will change on every page.
I need a master custom field that can be altered from one location, thus a master, something like this:
select p.*, m.*, d.* from datafeeds as d, products as p left outer join meta as m on [login to view URL] = [login to view URL] where p.datafeed_id = [login to view URL] and ((match([login to view URL]) against ('+brief' in boolean mode)) and (match([login to view URL]) against ('+CustomField2 +bikini' in boolean mode)) or ((match([login to view URL]) against ('+CustomField2' in boolean mode)) and [login to view URL] like '%bikini%' or (match([login to view URL]) against ('+bikini' in boolean mode)) and [login to view URL] like '%CustomField2%')) order by p.display_price asc limit 2000
And I can the specify the 2nd custom query on each page individaully and they will be pulled into the master custom field.