The image type is deprecated, so do not use it.
The short answer is to use the type FILESTREAM if it is SQL 2008, or varbinary(max) if it is 2005 or earlier.
It is better to respond to using the FILESTREAM type if it is SQL 2008, rather than storing images in a database. Databases are not built for this type of thing, and throwing blob files can significantly affect performance. FILESTREAM bypasses the problem by storing the actual data in the file system; everything else is a sub-standard solution.
As for reading and writing to the varbinary column, if you decide to use this imperfect approach, it will be presented as a stream in PHP. This is what you get from the query as a column value, and I believe that you should insert as a parameter.
Aaronaught
source share