fp1 mysql_result this- db- query SELECT SUM topic_like like FROM topic

1
2
$fp1 = mysql_result($this->db->query("SELECT SUM(`topic_like`.`like`) FROM `topic_like`, `topic` WHERE `topic`.`user` = '$uid' AND `topic_like`.`where` = `topic`.`id` AND `type` = '0'"), 0);
$fp2 = mysql_result($this->db->query("SELECT SUM(`topic_like`.`like`) FROM `topic_like`, `topic_comments` WHERE `topic_comments`.`user` = '$uid' AND `topic_like`.`where` = `topic_comments`.`id` AND `type` = '0'"), 0);