利用gettotal统计查询来调用帝国CMS当前栏目缩略图方法
当前栏目ID
<?=$empire->gettotal("select classid as total from {$dbtbpre}enewsclass where classid={$GLOBALS['navclassid']} limit 1")?>
当前栏目的缩略图:
<?=$empire->gettotal("select classimg as total from {$dbtbpre}enewsclass where classid={$GLOBALS['navclassid']} limit 1")?>
当前父栏目ID
<?=$empire->gettotal("select classid as total from {$dbtbpre}enewsclass where classid={$class_r[$navclassid][bclassid]} limit 1")?>
当前父栏目的缩略图
<?=$empire->gettotal("select classimg as total from {$dbtbpre}enewsclass where classid={$class_r[$navclassid][bclassid]} limit 1")?>
注释:调用什么字段就填写什么字段,如栏目ID:classid 、栏目图片:classimg
注意:gettotal用count(*)时为统计,用*时为字段;*号也可以是字段如:classid
标签: