function valid_session() { $res = MySql::query_row("SELECT count(id) as count_s FROM " . $this->session_table . " WHERE id='" . $this->getSessionID() . "'"); if ($res['count_s'] == 0) { $rez = MySql::query("INSERT INTO " . $this->session_table . " VALUES ('" . $this->getSessionID() . "'," . time() . ",'" . $GLOBALS['REMOTE_ADDR'] . "')"); $this->s_touch(); } $this->loadvars(); // $this->gc(); $res = MySql::query_row("SELECT count(id) as count_s FROM " . $this->session_table . " WHERE id='" . $this->getSessionID() . "'"); if ($res['count_s'] != 0) { return true; } else { return false; } }
function getOne() { $sql = $this->getQueryStr(); return MySql::query_row($sql); }