while (!$rs->EOF) { $o = $rs->FetchNextObj(); $id = $o->id; $gd = gdDecodeAssoc($o->gamedata); p_red($o->fn . " " . $o->ln . "[" . $o->id . "]:\n"); for ($w = 1; $w <= $game_weeks; $w++) { $wvs = "w" . $w . "v"; $wvl = "w" . $w . "vendor"; if ($o->{$wvs} == "" && $gd[$wvl] != "") { $vn = getvname($gd[$wvl], $w, $o->cls); $sql = "update tracking set {$wvl}='{$vn}' where user_id={$id}"; p_red($sql); dbExec($sql); } } p_red(""); } exit; } if (rt("reset")) { b("clearing raised money for teams and students"); //dbExec("delete from vars"); //p("cleared vars table"); dbExec("update tracking set raisedmoney=0"); p("cleared tracking.raisedmoney"); dbExec("update groups set raisedmoney=0"); p("cleared groups.raisedmoney"); dbExec("delete from results"); dbExec("insert into results (uid,gid)\n\t\t\t\tselect id,group_id from users where active=1 and user_type='s' and group_id!=0 and gamedata != ''"); p("Done"); }
$val = rt($name); if ($val == "") { $val = "null"; } // causes timestamp to auto-update $sql .= $val; } else { if ($type == "float") { $val = rt($name); if ($val == "") { $val = 0; } $sql .= $val; } else { print "<br>"; p_red("UNHANDLED FIELD TYPE: {$type}"); print "<br>"; $sql .= 0; } } } } } $n++; } $sql .= " where id=" . $id; if ($db->Execute($sql)) { p_green("Record updated OK."); } else { p_sqlfail($db, $sql); }