I read in the mySQL manual, “Currently, you cannot update a table and select from the same table in a subquery.” So what is the best way to take the user IDs from this first query…
SELECT uID
FROM users
WHERE sponsorID = 717
and memberType = 'No'
and uID in (select uID from campaigns where type = 'Enrollment' and answer in ('Contact', 'Purchase')
and status = 'Undiscovered');
…and then turn right around and update the campaigns table with this
update campaigns set status = 'Discovered' where uID in (the uIDs from the result of the first query)
Thanks!