Hi guys,

I've have a table look like this:
Code:
id     receiver     sender    urgency_level     action
1      Adam        John       Medium              0
2      Adam        Doe        High                   0
3      Adam        Smith     Low                    0
And the values of the urgency_level are:
Code:
High
Medium
Low
How do I show only one loop in this query:
Code:
$receiver = 'Adam';
$sender   = 'xxx';
"SELECT * FROM urgent_message WHERE receiver = '$receiver' AND sender = '$sender' AND action = '0' GROUP BY 

receiver ORDER BY id LIMIT 3"
Here are the codes of my loops:
Code:
while($row = mysql_fetch_array()) {
     if($row[' urgency_level'] == 'High' && $row['action'] >= 1) {
          echo "Done.";
     }elseif($row[' urgency_level'] == 'High' && $row['action'] == 0) {
          echo "High";
     }
     if($row[' urgency_level'] == 'Medium' && $row['action'] >= 1) {
          echo "Done.";
     }elseif($row[' urgency_level'] == 'Medium' && $row['action'] == 0) {
          echo "Medium";
     }
     if($row[' urgency_level'] == 'Low' && $row['action'] >= 1) {
          echo "Done.";
     }elseif($row[' urgency_level'] == 'Low' && $row['action'] == 0) {
          echo "Low";
     }
}
If the action is taken the result looks like this:
Code:
Done
Medium
Low
High
Done
Low
High
Medium
Done
How do I show the result just like these:
Code:
Done     or     Done        or     High        or      High     or    Not repeat too many loops
Done             Medium            Medium            Done
Done             Done                Low                  Done
Additionaly, I also want to count High alert messages Adam received from John too, but that's just in case.

Thanks