b0byan
asked on
Sort parameter values
Hello,
I have an mysql query which need to be filtered by the values from a parameter that looks like this: <url>?featuresId=18, 2, 50
The issue is that i need the values to be ordered ascending in order to display the correct results. The received values should be like (2,18,50)
My sql query looks something like this:
get_features_query = "select * from features where feature_name like '%|" . str_replace(",", "|%|", $HTTP_GET_VARS['featuresId ']) . "|%'"
Thanks
I have an mysql query which need to be filtered by the values from a parameter that looks like this: <url>?featuresId=18, 2, 50
The issue is that i need the values to be ordered ascending in order to display the correct results. The received values should be like (2,18,50)
My sql query looks something like this:
get_features_query = "select * from features where feature_name like '%|" . str_replace(",", "|%|", $HTTP_GET_VARS['featuresId
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you please guide me here because i don't know this stuff very well.
ASKER
Thanks. Took me a while to understand how to echo an array
Open in new window