hi,

i have a table setup where the user selects multiple check boxes from a form and it inserts into the table. this works fine and when i do a report i can do something like this:

SELECT COUNT(*) as MembersCount, MemberCounty  FROM membersDetails WHERE MemOpportWith LIKE '%msg%' GROUP BY MemberCounty ORDER BY MembersCount DESC

this is good if you know the columns you are searching unfortunately each new category that is added adds a new column into the table so i need a way of doing a count of the most popular product ids from the products table with the members table above which stores the ids in multiple columns.

is this possible?

many thanks

Show the table definitions (the CREATE TABLE statements). And your design is flawed. Do not add a column for each category but store categories in their own table and refer to that table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.