Skyrider
05-04-2015, 09:34 PM
I'm trying to run a SQL query code:
{
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET usergroupid = x
WHERE usergroupid = x");
}
of which appears to be working (with the rest of the other IF codes included), but I can't seem to figure out how to run multiple arrays in a single SET command. for example, with the usergroupID that is being set, I'd like to include the displaygroupid and title as well. I've tried:
{
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET usergroupid = 10, displaygroupid = 1
WHERE usergroupid = 6");
}
But I appear to be getting a SQL error with that one. Anyone could land a hand?
Side question. If anyone has a better idea how to include the code so the usergroup, eg changes are being logged in to the users history through admincp, please let me know.
{
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET usergroupid = x
WHERE usergroupid = x");
}
of which appears to be working (with the rest of the other IF codes included), but I can't seem to figure out how to run multiple arrays in a single SET command. for example, with the usergroupID that is being set, I'd like to include the displaygroupid and title as well. I've tried:
{
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET usergroupid = 10, displaygroupid = 1
WHERE usergroupid = 6");
}
But I appear to be getting a SQL error with that one. Anyone could land a hand?
Side question. If anyone has a better idea how to include the code so the usergroup, eg changes are being logged in to the users history through admincp, please let me know.