From e3f6db856af0d39d9996d520a2f0aa542a13a4df Mon Sep 17 00:00:00 2001 From: sparkyx Date: Tue, 18 Dec 2007 22:12:54 +0000 Subject: [PATCH] Remove sql error --- include/class_bud_detail.php | 7 ++++++- include/class_widget.php | 2 +- include/constant.php | 2 +- include/postgres.php | 10 +++++----- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/class_bud_detail.php b/include/class_bud_detail.php index 66b21be25..20a602d84 100644 --- a/include/class_bud_detail.php +++ b/include/class_bud_detail.php @@ -94,7 +94,12 @@ class Bud_Detail { } - + static function get_list($p_cn,$p_bh_id,$pa_id=0) { + $pa_filter=($pa_id)?" and pa_id = $pa_id ":""; + $sql="select * from bud_detail join bud_detail_periode using(bd_id) ". + " right join parm_periode using (p_id) ". + " where bh_id= $bh_id $pa_filter " + } static function testme() { $cn=DbConnect(dossier::id()); $a=new Bud_Detail($cn); diff --git a/include/class_widget.php b/include/class_widget.php index 3360af72b..13d75171b 100644 --- a/include/class_widget.php +++ b/include/class_widget.php @@ -150,7 +150,7 @@ class widget { if ($this->readonly==false ) { //echo "Selected ".$this->selected; - $r="name\" NAME=\"$this->name\" $this->javascript>"; for ( $i=0;$ivalue);$i++) { $checked=($this->selected==$this->value[$i]['value'])?"SELECTED":""; diff --git a/include/constant.php b/include/constant.php index 73233c60e..3e8e9d674 100644 --- a/include/constant.php +++ b/include/constant.php @@ -36,7 +36,7 @@ define ("domaine",""); define ("MAX_COMPTE",4); -define ("DEBUG","true"); +define ("DEBUG","false"); // securite correspond a la table // action diff --git a/include/postgres.php b/include/postgres.php index e5ab89dd8..13b369cb9 100644 --- a/include/postgres.php +++ b/include/postgres.php @@ -159,14 +159,14 @@ function ExecSqlParam($p_connection, $p_string,$p_array) { //---- pg_set_client_encoding($p_connection,'latin1'); - if (!DEBUG ) ob_start(); + ob_start(); $ret=pg_query_params($p_connection,$p_string,$p_array); if ( ! $ret ) { - if (!DEBUG )ob_clean(); - $r=$p_string."array ".var_export($p_array,TRUE); - throw new Exception (" SQL ERROR $r",1); + ob_clean(); + $r=$p_string."array ".var_export($p_array,TRUE); + throw new Exception (" SQL ERROR $r",1); } - if (!DEBUG ) ob_flush(); + ob_flush(); return $ret; }