PHP5中将BYTEA绑定到PGSQL PDO准备语句
我似乎找不到使用 PHP5 的 PDO 和 PostgreSQL 将 bytea 绑定到准备好的语句的方法。这是我想象的工作方式...
$this->stmtPDO = $this->hPDO->prepare (
'INSERT INTO board.feedback ("created", "title", "payloaddata")
VALUES (NOW(), :title, :payload) RETURNING psk;',
array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL)
);
$this->stmtPDO->bindParam(":payload", $payload);
$this->stmtPDO->bindParam(":title", $title);
$this->stmtPDO->execute();
有人找到了一个简单的解决方案吗?
I cannot seem to find a way to bind a bytea to a prepared statement using PHP5's PDO and PostgreSQL. Heres how i imagine this working...
$this->stmtPDO = $this->hPDO->prepare (
'INSERT INTO board.feedback ("created", "title", "payloaddata")
VALUES (NOW(), :title, :payload) RETURNING psk;',
array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL)
);
$this->stmtPDO->bindParam(":payload", $payload);
$this->stmtPDO->bindParam(":title", $title);
$this->stmtPDO->execute();
Has anyone found an easy solution for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过将参数类型设置为
PDO::PARAM_LOB
?例如
Have you tried to set the type of the parameter to
PDO::PARAM_LOB
?E.g.