What is the most efficient way to execute recursive complex queries?

Make the user query when the job is submitted and put all matching subscribers in a queue. At the end of the day run through the queue once and send the mails.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)