How do I display the correct number of comments for my status system?
<p>I'm creating a system where users can write their current status and other users can comment.</p>

<p>If anyone has commented on a user's status the user will get notified, but I'm having an issue coding this behavior.</p>

<p>My desired behavior is this: if i have one comment on my status (by one user, of course):</p>

<pre><code>echo "user has commented your status"
</code></pre>

<p>If I have two comments in 2 of my statuses (and the both are from same user):</p>

<pre>
"user has commented your status" 
"user has commented your status" 
</pre>

<p>(the text should be printed twice, each for one status)</p>

<p>If I have 3 comments in my 2 statuses (where the 1st status has 1 comment from one user, and the second has 2 by different users)</p>

<pre><code>echo "More than one users has commented your status"
echo "user has commented your status"
</code></pre>

<p>So if I have 2 comments in 1 status (where both comments are different user and NOT the same)</p>

<pre><code>echo "More than one users has commented your status"
</code></pre>

<p>To summarize: my system should only echo one time for EACH status notification. If its one comment from one user, or more comment in one status, from one user, you will get:</p>

<pre><code>echo "user has commented your status"
</code></pre>

<p>but if comments come from different users in one status,  you will get:</p>

<pre><code>echo "more than one has commented your status
</code></pre>

<p>When a user comments, it also saves in <code>users_msgs</code> a row, with:</p>

<pre><code>uID | nData | icon
</code></pre>

<ul>
<li><code>uID</code> contains the status creator's id (not the id of the user who commented)</li>
<li><code>icon</code> contains the commenting user's id.</li>
<li><code>nData</code> contains the status id.</li>
</ul>

<p>(please do not comment on the names of the columns)</p>

<p>How can I do this? I don't know where to start. </p>

<p>The only thing that I know should be done is that in the query should be <code>uID = '$USER'</code> (where <code>$USER</code> is the id of the signed-in user). But how do I check if there's more than one user that has commented per status id (<code>nData</code>), and if not show a single message of <code>user has commented on your status</code>.</p>

<p>If something's unclear please comment and I'll update my question.</p>
