esc($guid); $query = "SELECT * FROM " . $table . " WHERE guid = '" . $guid . "'"; $res = $this->query($query); if (!count($res)) return; $res = $res[0]; foreach ($fields as $field) { if (isset($res[$field])) $this->$field = $res[$field]; } } } ?>