Bind BYTEA to PGSQL PDO Prepared Report in PHP5

I cannot find a way to bind a byte to a prepared statement using PHP5 PDO and PostgreSQL. This is how I imagine how it works ...

$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?

+4
source share
1 answer

Have you tried setting the parameter type PDO::PARAM_LOB ? For instance.

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

Source: https://habr.com/ru/post/1343785/


All Articles