views:

52

answers:

1

I have SQL Server with following table :

table PROMO, column:
  • code , varchar(10)
  • name , varchar(10)
  • image_data, image
  • desc , text

How to insert image file as binary into sql server using PHP PDO? the image will be stored in column image_data

EDIT: 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
));
A: 

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

Col. Shrapnel
I mean, what type of variable should I pass to the PDO parameter ?
Permana