Need to have an applescript query mysql DB for a specific field value

I want to have a script check a mysql database every minute, or so, for the presence of a command in a specific field. For example a remote machine (machine B) would check in to see if it needs to update, reboot, connect to and IP address via SSH, etc. and would know to do this via the rest of the applescript, like an if/then statement.

I know it a lot, but I could use some help, Thanks