Click to See Complete Forum and Search --> : How to insert image into MS SQL 2000?


Anon
02-21-2001, 09:06 PM
I had saw some code to insert and select image using php4 and mysql. I use almost the same method to insert image to MS SQL2000.
The image size is 128KB. But i just get the message like below. about 20 lines:

Warning: MS SQL message: The identifier that starts with 'A?œ¸y?~%à²?Àbs\\l?PÊò¼\"S?áòìf/?(ÅÎ\\=\\Ei9m ÙòB1_èg‹^à|?×Áâ}ŸöÆy‰È??œ\\g‰«ý¹—BšWJQÃR? -;.JP„¦¥^*j?Õ\"Šþ?½û%6' is too long. Maximum length is 128. (severity 15) in D:\Inetpub\wwwroot\cgi-bin\insertimg.php on line 6

anybody have some idea?

Anon
05-08-2002, 02:20 PM
The way I have found to be most reliable is to base64_encode your image then insert that into a text field in your table.
Make sure you pump up the following values in your php.ini and restart IIS
mssql.textlimit = 2147483647
mssql.textsize = 2147483647

when you want to view it.. select the data, base64_decode the variable storing the data. perform a stripslashes on it and you should have exactly what you started with.. try not to go over about a 1 meg or so with this format.

Hope this helps.