array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'pdo-pgsql.lobunlink.php', 1 => 'Pdo\\Pgsql::lobUnlink', 2 => 'Deletes the large object', ), 'up' => array ( 0 => 'class.pdo-pgsql.php', 1 => 'Pdo\\Pgsql', ), 'prev' => array ( 0 => 'pdo-pgsql.lobopen.php', 1 => 'Pdo\\Pgsql::lobOpen', ), 'next' => array ( 0 => 'pdo-pgsql.setnoticecallback.php', 1 => 'Pdo\\Pgsql::setNoticeCallback', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/pdo_pgsql/pdo/pgsql/lobunlink.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 8 >= 8.4.0)
Pdo\Pgsql::lobUnlink — Deletes the large object
Deletes a large object from the database identified by OID.
Зауваження: This function, and all manipulations of the large object, must be called and carried out within a transaction.
oid
Приклад #1 Pdo\Pgsql::lobUnlink() example
This example unlinks a large object from the database prior to deleting the row that references it from the blobs table are used in the examples of Pdo\Pgsql::lobCreate() and Pdo\Pgsql::lobOpen().
<?php
$db = new PDO('pgsql:dbname=test host=localhost', $user, $pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->beginTransaction();
$db->pgsqlLOBUnlink($oid);
$stmt = $db->prepare("DELETE FROM BLOBS where ident = ?");
$stmt->execute(array($some_id));
$db->commit();
?>