开发者

Bind BYTEA to PGSQL PDO Prepared Statement in PHP5

开发者 https://www.devze.com 2023-02-17 10:22 出处:网络
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...

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开发者_如何学Go anyone found an easy solution for this?


Have you tried to set the type of the parameter to PDO::PARAM_LOB? E.g.

$this->stmtPDO->bindParam(":payload", $payload, PDO::PARAM_LOB);?
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号