function DatabaseUpdateLOBTestCase::testUpdateMultipleBlob
Confirm that we can update two blob columns in the same table.
File
-
modules/
simpletest/ tests/ database_test.test, line 1124
Class
- DatabaseUpdateLOBTestCase
- Test update queries involving LOB values.
Code
function testUpdateMultipleBlob() {
$id = db_insert('test_two_blobs')->fields(array(
'blob1' => 'This is',
'blob2' => 'a test',
))
->execute();
db_update('test_two_blobs')->condition('id', $id)
->fields(array(
'blob1' => 'and so',
'blob2' => 'is this',
))
->execute();
$r = db_query('SELECT * FROM {test_two_blobs} WHERE id = :id', array(
':id' => $id,
))->fetchAssoc();
$this->assertTrue($r['blob1'] === 'and so' && $r['blob2'] === 'is this', 'Can update multiple blobs per row.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.