Hi,
I have an mysql query which need to be filtered by the values of an url parameter that looks like this: <url>?featuresId=18, 2, 50
I have the array below to sort my values:
------------------
$temp=explode(',', $HTTP_GET_VARS['featuresId']);
foreach($temp as $index=>$value)
{
if(is_int($value))
{
$temp[$index]=(int)$value;
}
else
{
unset($temp[$index]);
}
}
asort($temp);
$get_features_query = "select * from features where feature_name like '%|" . implode("|%|", $temp) . "|%'";
-------------------------------------
The thing is i need the query to be filtered by feature_name like this:
$get_features_query = "select * from features where feature_name like %|2|%|18|%|50|%;
Any ideas how can i get to the bottom of this?
Thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
This award recognizes an author who contributes the highest volume of original works or content. Recipients of this award produce extremely valuable content that prioritizes accuracy, relevancy, and professionalism.