db=$p_cn; $Res=ExecSql($p_cn,"select * from parameter where pr_id like 'MY_%'"); for ($i = 0;$i < pg_NumRows($Res);$i++) { $row=pg_fetch_array($Res,$i); $key=$row['pr_id']; $elt=$row['pr_value']; // store value here $this->{"$key"}=$elt; } } /* function UpdateRow ************************************************** * Purpose : Update a row * * parm : * - give the attribut name * gen : * - none * return: * -none */ function UpdateRow($p_attr) { $value=FormatString($this->{"$p_attr"}); $Res=ExecSql($this->db,"update parameter set pr_value='$value' where pr_id='$p_attr'"); } /* function Save ************************************************** * Purpose : save data * * parm : * - none * gen : * - none * return: * - nothing */ function Save() { $this->UpdateRow('MY_NAME'); $this->UpdateRow('MY_TVA'); $this->UpdateRow('MY_STREET'); $this->UpdateRow('MY_NUMBER'); $this->UpdateRow('MY_CP'); $this->UpdateRow('MY_COMMUNE'); } }