title: continuously checking data in mysql database and using php
body: <p>I'm working on a system using php and mysql. It currently has a working sms feature which supports sending messages to users and receiving the messages sent by users. All sent and reveived messages are stored in different tables (one for sent and another for received) and contains info such as the number of the sender, the message, time/date etc. Most of the time, users only send YES or NO messages and these are tallied accordingly.</p>
  
  <p>What I am trying to do is using the count function in mysql, I would continuously check the messages which contains "YES", and once the count reached a certain amount let's say "5", it would automatically retrieve all the values (number of the sender, the message, time/date etc.) so that I can further manipulate the data retrieved.</p>
  
  <p>Any ideas on how to achieve this would be greatly appreciated. Please keep answers/suggestions as simple as possible.</p>
  
  <p>Thank you!</p>