PDA

View Full Version : [SQL] modify table PER USER


Dr.CustUmz
02-26-2015, 02:26 AM
so i have a query that updates a table:
$vbulletin->db->query("
UPDATE `" . TABLE_PREFIX . "user`
SET idle = '1'
");

it works fine except for when it runs, it updates ALL users idle column in the DB

i know it needs a WHERE like:
WHERE userid = " . {$vbulletin->userinfo['userid']}
'but even after combing core files i am unable to get this to trigger just for the current user.

--------------- Added 1424926781 at 1424926781 ---------------

Update* i have solved this with the help of this thread (https://vborg.vbsupport.ru/showthread.php?t=280917) the answer wasnt printed out, but that article helped alot

by using:
WHERE userid = '" . $vbulletin->userinfo['userid'] . "'