开发者

Store image data type using PHP

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜