db =& $db; $this->tpl =& $tpl; // If $ID is set, attempt to retrieve data. if (!empty($ID)) { $this->getAddOn($ID); } } function getAddOn($ID) { $this->db->query(" SELECT main.*, userprofiles.UserID, userprofiles.UserName, userprofiles.UserEmail, userprofiles.UserWebsite, userprofiles.UserEmailHide FROM main INNER JOIN authorxref ON authorxref.ID = main.ID INNER JOIN userprofiles ON userprofiles.UserID = authorxref.UserID WHERE main.ID = '{$ID}' ", SQL_INIT, SQL_ASSOC); if (!empty($this->db->record)) { foreach ($this->db->record as $key=>$val) { $this->$key = $val; } } } }