私はクラスを持っていて、 "blob"型のピクチャを格納するカラムを初期化したいのですが、コードの緯線を見てくださいPHPのコンストラクタでピクチャ "blob"の型を初期化する方法
public function __construct($data=array()) {
if (isset($data['id'])) $this->id = (int) $data['id'];
if (isset($data['date'])) $this->date= (int) $data['date'];
if (isset($data['topic'])) $this->topic = preg_replace ("/[^\.\,\-\_\'\"\@\?\!\:\$ a-zA-Z0-9()]/", "", $data['topic']);
if (isset($data['author'])) $this->author = preg_replace ("/[^\.\,\-\_\'\"\@\?\!\:\$ a-zA-Z0-9()]/", "", $data['author']);
if (isset($data['content'])) $this->content = $data['content'];
if (isset($data['picture'])) $this->picture ="Here sholud be the Type" $data['picture'];
}
ストリングとして保存してください。 –
http://php.net/manual/language.types.type-juggling.php –