title: Trouble with comment notification in CodeIgniter
body: <p>I am running a social networking iPhone app using CodeIgniter. All notifications are working perfectly except for one: A user should receive a notification when another user comments on one of their posts, but currently, they are not receiving the notification. Here is the code:</p>
  
  <pre><code>function add_comment($postID, $postThumbURL, $postOwnerID, $userID, $username, $photoURL, $comment)
  {
      $now = $this-&gt;getDate();
      $timestamp = time();
      $sql = "insert into comments values('', '$postID', '$userID', '$now', '$timestamp', '$comment')";
      $this-&gt;db-&gt;query($sql);
      $commentID = $this-&gt;db-&gt;insert_id();
  
      $sql = "update posts set commentCount=commentCount+1 where postID='$postID'";
      $this-&gt;db-&gt;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-&gt;db-&gt;query($sql);
      $query = $query-&gt;result();
  
      $sql = "insert into notification values('', '$userID', '$postOwnerID', '$postID', '7', '".time()."')";
      $this-&gt;db-&gt;query($sql);
  
      return $query[0];
  }
  </code></pre>
  
  <p>Any help or advice on fixing this issue would be greatly appreciated. If you need any additional code, just ask. Thanks in advance!</p>