CodeIgniter を使用してソーシャル ネットワーキングの iPhone アプリを実行しています。1 つを除いて、すべての通知は完全に機能しています。別のユーザーが投稿の 1 つにコメントすると、ユーザーは通知を受け取るはずですが、現在、通知を受け取っていません。コードは次のとおりです。
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];
}
この問題を解決するためのヘルプやアドバイスをいただければ幸いです。追加のコードが必要な場合は、お問い合わせください。前もって感謝します!