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; } } /*! ************************************************** * \brief Update a row * * * \param give the attribut name * */ function UpdateRow($p_attr) { $value=FormatString($this->{"$p_attr"}); $Res=ExecSql($this->db,"update parameter set pr_value='$value' where pr_id='$p_attr'"); } /*! ************************************************** * \brief save data * * */ 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_TEL'); $this->UpdateRow('MY_PAYS'); $this->UpdateRow('MY_COMMUNE'); $this->UpdateRow('MY_FAX'); } }