ADOdb Library for PHP Manual
Prev UpdateBlob Next

UpdateBlob($table,$column,$val,$where)

Allows you to store a blob (in $val) into $table into $column in a row at $where.
Usage:

    # for oracle
    
$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, empty_blob())');
    
$conn->UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');
    
    
# non oracle databases
    
$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
    
$conn->UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');

Returns true if succesful, false otherwise. Supported by MySQL, PostgreSQL, Oci8, Oci8po and Interbase drivers. Other drivers might work, depending on the state of development.

Note that when an Interbase blob is retrieved using SELECT, it still needs to be decoded using $connection->DecodeBlob($blob); to derive the original value in versions of PHP before 4.1.0.

For PostgreSQL, you can store your blob using blob oid's or as a bytea field. You can use bytea fields but not blob oid's currently with UpdateBlob( ). Conversely UpdateBlobFile( ) supports oid's, but not bytea data.

If you do not pass in an oid, then UpdateBlob() assumes that you are storing in bytea fields.

If you do not have any blob fields, you can improve general SQL query performance by disabling blob handling with $connection->disableBlobs = true.


Prev Home Next
GetUpdateSQL Up UpdateClob

Sponsored by phpLens