开发者

Store image data type using PHP

开发者 https://www.devze.com 2022-12-22 13:47 出处:网络
I have an SQL Server database with following table. Table PROMO, column: code , varchar(10) name开发者_JAVA技巧 , varchar(10)

I have an SQL Server database with following table.

Table PROMO, column:

How do I insert an image file as a binary into SQL Server using PHP PDO? The image will be stored in column image_data.

What type of variable should I pass to the PDO parameter?

$stmt = $conn->prepare($query, array(
    ':code'        => $code,
    ':name'        => $name,
    ':image_data'  => $imageData,
    ':desc'        => $desc
));


Exactly the same way as you store any other data, text for example. There is no difference.

0

精彩评论

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

关注公众号