The only way to do automatic running of a PHP script would be
through a shceduled task (cron, for example)
If you are using a cheap hosting company, they probably don't
allow you to modify your crontab (that's the scheduling file)
If you are using something other than MySQL, I imagine this could
be written using DB triggers (everytime somebody adds/updates
a profile, it would check against everybody else's criteria)