Horde_Db_Adapter::updateBlob PHP Method

updateBlob() public method

Updates rows including BLOBs into a table.
public updateBlob ( string $table, array $fields, string $where = '' )
$table string The table name.
$fields array A hash of column names and values. BLOB columns must be provided as Horde_Db_Value_Binary objects.
$where string A WHERE clause.
    public function updateBlob($table, $fields, $where = '');

Usage Example

Ejemplo n.º 1
0
Archivo: Sql.php Proyecto: horde/horde
 /**
  */
 public function write($id, $session_data)
 {
     if (!$this->_db->isActive()) {
         $this->_db->reconnect();
         $this->_db->beginDbTransaction();
     }
     /* Check if session exists. */
     try {
         $exists = $this->_db->selectValue(sprintf('SELECT 1 FROM %s WHERE session_id = ?', $this->_params['table']), array($id));
     } catch (Horde_Db_Exception $e) {
         return false;
     }
     /* Update or insert session data. */
     $values = array('session_data' => new Horde_Db_Value_Binary($session_data), 'session_lastmodified' => time());
     try {
         if ($exists) {
             $this->_db->updateBlob($this->_params['table'], $values, array('session_id = ?', array($id)));
         } else {
             $this->_db->insertBlob($this->_params['table'], array_merge(array('session_id' => $id), $values));
         }
         $this->_db->commitDbTransaction();
     } catch (Horde_Db_Exception $e) {
         try {
             $this->_db->rollbackDbTransaction();
         } catch (Horde_Db_Exception $e) {
         }
         return false;
     }
     return true;
 }
All Usage Examples Of Horde_Db_Adapter::updateBlob