Quote:
Originally Posted by John Lester
Dangit ... I knew I didn't fully understand the JOINs ...
The subscribethread table doesn't have an email column, but if I JOIN the user table I don't have to mention the email table (in the JOIN) in order to use it in the UPDATE ... WHERE as long as the userid from the user table matches the userid from subscribethread table?
|
What's the point of the email address in the query? Since you have a users userid, in the $id variable, that will uniquely identify everything you need to update the appropriate stuff in the subscriptionthread table.
If what I understand you want to achieve why not use the following query:
PHP Code:
$db->query("UPDATE " .TABLE_PREFIX. "subscribethread
SET emailupdate = 0
WHERE emailupdate IN (1,2,3)
AND userid = $id");
Also note two things, first your $db->query should use () not {} and have a ; at the end, and also an update query can only be applied to a table and not a join.