11-27-2010, 11:03 AM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Jan 2009
Posts: 8
Thanks: 0
|
Comparing string from array with mysql field
Hi, i have one problem with my search script
i have multiple checkboxes in search form, when user check eg. 5 boxes, after form process i take array and implode that array into one string and i get eg. $implodString = 1|4|27|34|55;
So, what i need is a way to compare this with mysql field where i have just one value eg. |4| - (this is in my field).
I need something like this
SELECT FROM `TABLE` WHERE `FIELD` LIKE %$implodString%
with showen values looks like this
SELECT FROM `TABLE` WHERE `|4|` LIKE % 1|4|27|34|55 %
i need to find all fields where we have any number from imploded array, in this case i need all fields where we have number 1,4,27,34 or 55.
Thank you for help.
|
|
|
|