$query = mysql_query("select count(id) as toplam from icerikler where katid='$katid'");
$row = mysql_fetch_array($query);
echo $row['toplam'];