I have 2 tables on my mysql database : - restaurant - restaurant_type
restaurant has 3 column : id, idtype, name
Example :
- 1, 1-2, Restaurant name
- 2, 2-3-5, Restaurant name
restaurant_type has 2 column : idtype, typename
Example :
- Salad
- Burger
- Steak house
- Japanese
- French fries
For that moment, my sql request is :
mysql_query("select distinct
restaurant.idtype,
restaurant_type.idtype,
restaurant_type.typename
from restaurant,restaurant_type
where restaurant.idtype=restaurant_type.idtype
order by restaurant_type.typename");
But I don't know how can I add explode function to search different idtype.
An idea to help me ?
Thank you !
explodein mysql and other solutions for attempting similar are, to be honest, very messy ( stackoverflow.com/questions/471914/… ). You would be better creating a third table to do lookups - one that holds the restaurant id and the typesrestauranttables columnidtypethan you can simply useFIND_IN_SETfunction of MySQL