function UpdateBlob($table, $column, $val, $where, $blobtype = 'BLOB')
 {
     $type = $blobtype == 'TEXT' ? 1 : 0;
     $blobid = ifx_create_blob($type, 0, $val);
     return $this->Execute("UPDATE {$table} SET {$column}=(?) WHERE {$where}", array($blobid));
 }
 /**
  * Execute an SQL query with blob fields processing
  * @param String sql
  * @param Array blobs
  * @param Array blobTypes
  * @return Boolean
  */
 public function execWithBlobProcessing($sql, $blobs, $blobTypes = array())
 {
     if (!count($blobs)) {
         $this->exec($sql);
         return;
     }
     $blobidarray = array();
     foreach ($blobs as $fname => $fvalue) {
         if (IsTextType($blobTypes[$fname])) {
             $blob_type = 1;
         } else {
             $blob_type = 0;
         }
         $blobidarray[] = ifx_create_blob($blob_type, 0, $fvalue);
     }
     return @ifx_query($sql, $this->conn, $blobidarray);
 }
Пример #3
0
 function GetLOBFieldValue($prepared_query, $parameter, $lob, &$value, $binary)
 {
     if (!$this->Connect(0)) {
         return 0;
     }
     for ($blob_data = ""; !MetabaseEndOfLOB($lob);) {
         if (MetabaseReadLOB($lob, $data, $this->lob_buffer_length) < 0) {
             return $this->SetError("Get LOB field value", MetabaseLOBError($lob));
         }
         $blob_data .= $data;
     }
     if (!($blob = ifx_create_blob($binary ? 0 : 1, 0, $blob_data))) {
         return $this->SetIFXError("Get LOB field value", "Could not create a blob");
     }
     if (!isset($this->query_parameters[$prepared_query])) {
         $this->query_parameters[$prepared_query] = $this->query_parameter_values[$prepared_query] = array();
     }
     $query_parameter = count($this->query_parameters[$prepared_query]);
     $this->query_parameter_values[$prepared_query][$parameter] = $query_parameter;
     $this->query_parameters[$prepared_query][$query_parameter] = $blob;
     $value = "?";
     return 1;
 }
Пример #4
0
   function UpdateBlob($table, $column, $val, $where, $blobtype = 'BLOB')
   {
   		$type = ($blobtype == 'TEXT') ? 1 : 0;
		$blobid = ifx_create_blob($type,0,$val);
		return $this->Execute("UPDATE $table SET $column=(?) WHERE $where",array($blobid));
   }