CodeIgniter中的注释通知问题

时间:2013-05-12 08:49:20

标签: php mysql codeigniter notifications

我使用CodeIgniter运行社交网络iPhone应用程序。所有通知都可以正常工作,除了一个:用户应该在其他用户对其中一个帖子发表评论时收到通知,但目前他们没有收到通知。这是代码:

function add_comment($postID, $postThumbURL, $postOwnerID, $userID, $username, $photoURL, $comment)
{
    $now = $this->getDate();
    $timestamp = time();
    $sql = "insert into comments values('', '$postID', '$userID', '$now', '$timestamp', '$comment')";
    $this->db->query($sql);
    $commentID = $this->db->insert_id();

    $sql = "update posts set commentCount=commentCount+1 where postID='$postID'";
    $this->db->query($sql);

    $sql = "select c.nID as commentID, c.created_timestamp as created_at, c.comment, c.userID, u.username, u.photoURL from comments c LEFT JOIN users u ON(c.userID=u.id) where c.nID='".$commentID."'";
    $query = $this->db->query($sql);
    $query = $query->result();

    $sql = "insert into notification values('', '$userID', '$postOwnerID', '$postID', '7', '".time()."')";
    $this->db->query($sql);

    return $query[0];
}

非常感谢有关解决此问题的任何帮助或建议。如果您需要任何其他代码,请询问。提前谢谢!

0 个答案:

没有答案