HI I have an issue with the piece of code mentioned below which is been processed every 5 mins via hook_cron. Pls help

Issue I face here is that the update query in the third line of code is not getting effected due to some anonymous reason,

hence
users getting 100's of same mails to their inbox.

$mail_qry = db_query("SELECT * FROM {mail_queue} WHERE processed = 0 AND attempt < 6 LIMIT 100");
while($mail_alert = db_fetch_object($mail_qry))  {
  db_query("UPDATE {mail_queue} SET processed = %d, attempt = (attempt+1) WHERE qid = %d",1, $mail_alert->qid);
  drupal_mail('sms', 'notice', $to, user_preferred_language($account), $params, $from);
}

Note : I don't have any issues with the syntax or datatype handling in the code.

Thanks In advance for your help.
Uday

Comments

cweagans’s picture

Priority: Critical » Normal

Support requests are never critical or major.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.