Ok so I sorta started working on this again, and I can't figure out what's wrong here. I'm trying to copy the rows from subscribethread to unsub_subscribethread *yes it does exist*. Yes the option is selected in the ACP. The mod runs but doesn't spit out ANY errors, it also doesn't copy the rows
This is the select query I'm using
Code:
$unsubscribe = $db->query_read("SELECT NULL, userid, threadid, emailupdate, folderid, canview FROM " .TABLE_PREFIX. "subscribethread WHERE userid = '$id' AND emailupdate IN (1, 2,3)");
This is the code inside of the function
Code:
// If you selected to backup existing thread subscriptions this code will be exectued.
if ($vbulletin->options['advanced_unsubscribe_link_thread_sub_backup'])
{
// Copies existing thread subscriptions to the unsub_subscribethread table.
$db->query("
INSERT INTO " .TABLE_PREFIX. "unsub_subscribethread
SELECT NULL,
userid,
threadid,
emailupdate,
folderid,
canview
FROM " .TABLE_PREFIX. "subscribethread
WHERE userid = '$id'
AND emailupdate IN (1, 2, 3)");
}
If I run this query in phpmyadmin it works ...
Code:
INSERT INTO unsub_subscribethread
SELECT NULL,
userid,
threadid,
emailupdate,
folderid,
canview
FROM subscribethread
WHERE userid = 1
AND emailupdate IN (1, 2, 3)