php - mysql Find_in_set is better or single query check is better -
i have problem mysql find_in_set, because in table named menu_table in which:i store following data. want match value of menu_ids single menu_id of table
mt_id menu_ids --------------- 1 4,5,6, 2 7,8, or mt_id menu_ids ---------- 1 4 2 5 then don't understand how store value , better solution checking menu_ids?
do not store values separated comma. it's bad schema design. suggest design table this,
menu table
- menuid (pk)
- othercolumns...
other table
- mtid (pk)
- othercolumns...
menu_other table
- mtid (pk column menuid)
- menuid (fk)
example records
menu table
menuid othercolumn 1 aaaa 2 bbbb other table
mtid othercolumns 1 2 b 3 c 4 d 5 e 6 f menu_other table
menuid mtid 1 1 1 2 2 3 2 4 2 5
Comments
Post a Comment