SELECT m.c_id_m AS id, m.c_m_name AS name, t.c_id_t AS id, t.c_t_name AS name FROM `cat_marka` m LEFT JOIN `cat_type` t ON m.parent_cat=t.parent_cat AND m.c_act_m=t.c_act_t AND m.c_index=t.c_index WHERE m.c_index='1' AND m.c_act_m='1' AND m.parent_cat='{$row['cat_id']}'