在我的 osCommerce 商店中,我想获取没有子类别或子类别的类别的 parent_id。
我在我的代码中使用了以下内容:
$categories_query = tep_db_query("select c.categories_id, cd.categories_name
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.parent_id = '$parent_id' and
c.categories_id = cd.categories_id
order by sort_order, cd.categories_name");
当填写常量时,上面的内容转化为:
select c.categories_id, cd.categories_name
from categories c, categories_description cd
where c.parent_id = '$parent_id' and
c.categories_id = cd.categories_id
order by sort_order, cd.categories_name