if (mysql_result (mysql_query ("SELECT COUNT(*) FROM `blogs` WHERE `type` = 'dir' AND `id` = '$cat' LIMIT 1 "), 0) == 0)
Делаю так, не проходят проверку.
if ($db->query("SELECT COUNT(*) FROM `blogs` WHERE `type` = 'dir' AND `id` = '$cat' LIMIT 1 ")->fetchColumn())