Forum Moderators: coopster
I have a Table for each Merchant.
I need to introduce a Product Search facility accross ALL merchants Tables.
The way it works now is retrieval is confined to each Merchants own Table:
$query_TEST = "SELECT * FROM T101 WHERE product = 'widget'";
I need to search tables from T101 upwards as they are added.
I suppose it's too much to hope that MYSQL will accept wild cards.
Pleae tell me there is a simple way to do this that is not affected as Merchants/Tables are added/removed ongoing.
If this is too cumbersome for me to introduce and maintain, I could at this point retreat to a single Table and use a Merchant Code to select content for each merchants own pages.
My PHP skills are at the evolving stage, so please keep it very simple to understand if possible.
would do it, but of course that doesn't fix the problem of: what happens when the merchant T102 is removed and T104 is added.
You could you a seperate table of merchants and before you assemble your sql statement you could get a recordset of active merchants from that table and use that to make your sql statement for the search.
So you might have something like:
select * from merchants where active='1'
and that would give you a full list of active merchants (let's say T101, T103, T106 and T107) which would allow you to loop through, assemble the sql statement you need and use it in your next query.
Post if you want me to explain further. I can go into greater detail if you like.
Hopefully though, someone will provide a neater, easier solution.