Re: DataObject insert problem
| From: | Norbert Mocsnik | Date: | Mon, 08 Mar 2004 22:52:47 +0000 |
| Subject: | Re: DataObject insert problem | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11169@lists.php.net to get a copy of this message | ||
Hello,
Could you send the [media] section from your databasename.ini to the list?
Regards,
Norbert
Ryan King wrote:
$media = DB_DataObject::factory('media'); $media->setId($id); $media->setShort_description($short_description); $media->setLong_description($long_description); if (is_file($_FILES['media']['tmp_name'])) {$media->setType($_FILES['media']['type']); $media->setFile_name($_FILES['media']['name']); $file_path = $_FILES['media']['tmp_name']; $data = file_get_contents($file_path) or die( "Can't open file!" );$media->setData(base64_encode($data)); }When I then call $media->insert(), the sql that is produced does not include the 'data' field. When I dump the $media object, the encoded file is in the object, but for some reason does not get included in the sql insert statement. I've poked around in the DataObject source, but have not been able to figure out what's going on. -Ryan --------- http://homepage.mac.com/ryansking/