Quote:
Originally Posted by carpefile
unexpected t string error in line 19.
|
Of course. Sorry - left out a quotation mark. Try this (my example excludes two member groups for my forums) and uses lastactivity instead of lastpost:
Code:
$result = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "user WHERE lastactivity < '$datetime[lastpost]' AND ". TABLE_PREFIX . "usergroup != 20 AND ". TABLE_PREFIX . "usergroup != 23 AND emailDate < '$datetime[lastemail]' LIMIT $quantity");
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET emailDate = '$now' WHERE lastactivity < '$datetime[lastpost]' AND ". TABLE_PREFIX . "usergroup != 20 AND ". TABLE_PREFIX . "usergroup != 23 AND emailDate
< '$datetime[lastemail]' LIMIT $quantity");
Edit: Sorry - that SQL syntax is also incorrect.
My head hurts - any SQL gurus here?