PEAR DB: inserting image or binary into Oracle DB
| From: | Shawn Coomey | Date: | Thu, 18 Dec 2003 15:49:28 +0000 |
| Subject: | PEAR DB: inserting image or binary into Oracle DB | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9661@lists.php.net to get a copy of this message | ||
Hi folks-
I am brand new to PEAR, and am having some trouble with inserting a binary
file (image in this case) into an Oracle Database. I am trying to insert
the image data into a BLOB column.
Here's a code example:
/*****************
foreach ($_FILES as $key => $value){
if (!empty($_FILES[$key]['type'])){
$file = $_FILES[$key]['tmp_name'];
$alldata = array(array($file));
}
}
$sth = $db->prepare("INSERT INTO table_name (binary_data) VALUES (&)");
foreach ($alldata as $row) {
$test = $db->execute($sth, $row);
echo $test->getDebugInfo();
}
******************/
the result of getDebugInfo() is this:
[nativecode=ORA-01465: invalid hex number ]
Does PEAR DB handle BLOB's?
Thanks!
Shawn