function light_live() { $db = plugin_func('install', 'install_db', ses('qd')); if (!$db['live']) { return 'er'; } $sql = str_replace('_live', '_live2', $db['live']); mysql_query($sql); $tim = calc_date(30); $day = date('Y-m-d H:i:s', $tim); $lastid = sql('id', 'qdv', 'v', 'time>"' . $day . '" order by id limit 1'); if (is_numeric($lastid)) { msquery('insert into ' . ses('qdv2') . ' select * from ' . ses('qdv') . ' where id<' . $lastid); msquery('delete from ' . ses('qdv') . ' where id<"' . $lastid . '"'); reflush('qdv'); } return ses('qdv') . ' was cleaned from id ' . $lastid; }
function delete($bs, $id, $o = '') { msquery('delete from ' . $_SESSION[$bs] . ' where id="' . $id . '" limit 1'); if ($o) { reflush($bs, 1); } }