PDA

View Full Version : How to schedule a sql query


fevredsuk
11-15-2012, 01:56 PM
Hi im wanting to run a shedule task to reset the counts in a table my database to zero

I just need a but of help for what code to use in the php cron file

the query i am using is

UPDATE user SET mydbtabename = '0'

obviously replacing mydbtabename with the real name.

how do i put it into code

eg.

$vbulletin->db->query_write ???????????????????????

kh99
11-15-2012, 01:59 PM
I think you want this:
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET mydbtabename = '0'");

fevredsuk
11-15-2012, 02:01 PM
thankyou