Announcement

Collapse
No announcement yet.

Storing and retrieving image MSSQL via php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Storing and retrieving image MSSQL via php

    $datastring = file_get_contents("P1030001.JPG");
    $data = unpack("H*hex", $datastring);
    mssql_query("insert into images values ('P1030001.JPG', 0x".$data['hex'].")");

    $result = mssql_query("select szData from images where szName like 'P1030001.JPG'");
    $row = mssql_fetch_row($result);
    header("Content-type:image/jpeg;");
    echo $row[0];

    anyone has any aidea about this topic.
    I can store image to db but I cant display it.
    I am not sure whether the data is stored correct or not..
    Last edited by pagan_ist; Tue 18th Nov '03, 3:38am.
Loading...
Working...
X