I'm working on a project where i will be storing arrays/lists in a MySQL table and make a PHP based search on the information in the lists.
How i basically thought of doing this would be to put in the data like this:
column1
,2,6,9,30,
,3,5,8,
,5,6,13,16,17,
column2
,b,g,k,ro,
,c,e,t,
,d,h,i,ar,ez,
then search like this:
SELECT * FROM table_name WHERE column1 LIKE '%,3,%' OR column2 LIKE '%,h,%'
But i might have to search for five items in column1 and three in column2, which would make the query long and possibly slow?..
What i want to know is, is this a smart way to do it? Is there faster and/or better methods?..
Let me know if you have questions or if i'm not clear enough.