Hello All,
I am having a little touble trying to add a picture file to a MS SQL Server
database. In the MSSQL database the field has a datatype of image. This is
the code I am using
$fileHandle = fopen($fileUpload, "r");
$fileContent = fread($fileHandle, $fileUpload_size);
$fileContent = addslashes($fileContent);
$dbQuery = "INSERT INTO Pets VALUES ";
$dbQuery .= "(1, '$strDesc', '$fileUpload_type', '$fileContent')";
I may be way of, this code works fine with a MySQL database, but no luck
with MSSQL.
I am running under Windows 2000, for both databases.
The error message I get when I try the code with the MSSQL database is
Warning: MS SQL message: Line 1: Incorrect syntax near '\'. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: The identifier that starts with
'cB8Bcccccccccccccccccccccccccc' is too long. Maximum length is 30.
(severity 15) in c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: The identifier that starts with
'CDEFGHIJSTUVWXYZcdefghijstuvwx' is too long. Maximum length is 30.
(severity 15) in c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '$' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¤' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '£' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¤' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '£' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¥' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¥' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '$' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '£' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '£' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '$' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '£' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¤' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '$' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¤' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '£' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '$' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¤' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '$' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¥' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '¤' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL message: '£' is an invalid money value. (severity 15) in
c:\inetpub\wwwroot\php\petpics2\getfile.php on line 46
Warning: MS SQL: Query failed in c:\inetpub\wwwroot\php\petpics2\getfile.php
on line 46
Any ideas??
Thnaks
James