我用 Zend Framework + Postgres 写了一个网站。在 PostgreSQL 中有这张表:
create table images(
id serial,
title TEXT DEFAULT '',
thumbnail bytea NOT NULL,
original bytea NOT NULL,
PRIMARY KEY(id)
);
我打算在哪里存储图像数据。但是当我尝试从表(select thumbnail from images where id = $id
)中接收任何东西时:
$table = $mapper->getDbTable();
$select = $table->select();
$select->from($table,array('thumbnail'));
$select->where('id = ?',$id);
$res = $table->fetchRow($select);
die(print_r($res['thumbnail']));
我收到类似的东西:
Resource id #12_
但不是包含数据。
我如何(使用Zend_Db_Select
)接收这些数据,而不是 Resource id #129?对不起,我的英语不好 ...