qs_internal=="") exit (__FILE__.__LINE__." qs_internal est vide"); $sql="select qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, tva_label, tva_rate, qs_vat_code, qs_client, j_id from quant_sold left join tva_rate on (qs_vat_code=tva_id) where qs_internal='".$this->qs_internal."'"; $ret=$this->db->exec_sql($sql); // $res contains all the line $res=Database::fetch_all($ret); if ( sizeof($res)==0) return null; $count=0; foreach ($res as $row) { $t_gestion_sold=new gestion_sold($this->db); foreach ($row as $idx=>$value) $t_gestion_sold->$idx=$value; $array[$count]=clone $t_gestion_sold; $count++; } return $array; } }