cn=$p_cn; $this->bdp_id=0; $this->p_id=0; $this->bdp_amount=0; } /*!\brief delete */ function delete () { $sql="delete from bud_detail_periode where bdp_id=".$this->bdp_id; ExecSql($this->cn,$sql); } /*!\brief add a row in the table bud_detail_periode and set the this->bdp_id with the value in the row * */ function add(){ $sql="insert into bud_detail_periode(bdp_amount,p_id,bd_id) values ($1,$2,$3)". " returning bdp_id"; $value=array($this->bdp_amount,$this->p_id,$this->bd_id); try { $r=ExecSqlParam($this->cn,$sql,$value); $this->bdp_id=pg_fetch_result($r,0,0); } catch (Exception $e) { echo "Erreur : ".$e->getMessage(); } } /*!\brief for developper * */ static function test_me() { $cn=DbConnect(dossier::id()); print_r($cn); $obj=new Bud_Detail_Periode($cn); $obj->bdp_amount = 12; $obj->p_id=54; $obj->bd_id=10; $obj->add(); print_r($obj); echo '