if (date("Y",strtotime($date)) == $i) $selected = ' selected="selected"';
print('<option value="'.$i.'"'.$selected.'>'.$i.'</option>'."\n");
您好,
假设父列0表示&#34;它是主要类别&#34;在类别表中,其他是其他类别的子类别。我想选择所有cat1和cat1子类别的子项。
答案 0 :(得分:0)
检查此查询
select * from content_table where category IN (select id from category_table where parent IN
(select id from category_table where cat_title = 'cat1'))