data['id'] class RecordObj { protected $table; // protected?? protected $data; // protected?? function __Construct($table) { if($table == '') { echo 'no table input to construct'; return(false); } $this->table = $table; } function set_data($id='', $where_add='', $data='') { // can pass in id or data if($id != '') { if(!$this->set_data_for_id($id, $where_add)) { echo 'no record for that id'; return(false); } return(true); } elseif($data != '') { $this->data = $data; return(true); } else { echo 'no id or data input to set data'; return(false); } } function set_data_for_id($id, $where_add='') { return($this->data = Database::ado_get_row("SELECT * FROM $this->table WHERE id = '$id' $where_add")); } function get_data($field='') { return (!isset($this->data)) ? false : ($field != '') ? $this->data[$field] : $this->data; } } ?>