1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
   | function form(){
		$fieldName  = array(); 
	    $fieldLen  = array();
	    $fieldType  = array();
	    $fieldValue = array();
 
	    $count = odbc_num_fields( $this->req )+1;
		for ($i=1;$i<$count ;$i++){
			$fieldName[$i] = odbc_field_name($this->req, $i);  // nom du champ
		    $fieldLen[$i] = odbc_field_len($this->req, $i);   // longueur
		    $fieldType[$i] = odbc_field_type($this->req, $i);         // type du champ
		}
 
 
		odbc_fetch_row($this->req);
		for ($i=1;$i<$count ;$i++){
			$fieldValue[$i] = "";
			$fieldValue[$i] = odbc_result($this->req,$i);
		}
		$SQL = str_replace("from", "[*%&]", $SQL);
		$SQL = str_replace("where", "[*%&]", $SQL);
		list($fields,$table,$whereclause) = explode("[*%&]",$SQL);
 
 
		$form = new form(serialize($fieldName), serialize($fieldLen), serialize($fieldType), serialize($fieldValue), $table );
		return $form;
	} | 
Partager