<?php
/*
  页面侧边栏显示分类查看
*/
   $catNumQuery = "select count(cat.catName) as num,cat.catName,cat.catId  from cat,news where cat.catId=news.parentId group by cat.catName order by cat.catId ";//按照分类名称分组，按章分类升序排列，查询分类下面的文章数目，分类名称，分类Id
   $catNumResult=mysql_query($catNumQuery,$conn);
   while ($catNumRow1=mysql_fetch_array($catNumResult)) {
   	  $catNumRow[]=array('num'=>$catNumRow1['num'],'catId'=>$catNumRow1['catId'],'catName'=>$catNumRow1['catName']);
   }
   $smarty->assign('catNumRow',$catNumRow);
   $smarty->display('sidebarName.html');
?>