2
$query = "select id, xmldata from xmlcontent where id = '586655' OR id = '671347'"

$db = new PDO(...);
$stmt = $db->prepare($query);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);

var_dump($result);

output:

...
["XMLDATA"]=> resource(33) of type (stream)
...

how i can read this? i try:

stream_get_contents()

but nothing

with

stream_get_contents()

sometimes read some litle text, i would like to use and generic code from all SQL-s without binding params :(

ZiTAL
  • 3,466
  • 8
  • 35
  • 50

1 Answers1

0

Maybe you're trying to read twice from the same stream or just using old pdo_oci library with a bug (only last stream will be returned on multiple records).

For the last version, compiled from php source on Ubuntu server i just use lazy-load in ActiveRecord class:

public function getFullText()
{
    if (is_resource($this->fulltext)) {
        $this->fulltext = stream_get_contents($this->fulltext);
    }
    return $this->fulltext;
}

Where fulltext is CLOB.

UnstableFractal
  • 1,403
  • 2
  • 15
  • 29