ms sql and images..
"csr" <[email protected]>
| Newsgroups | gmane.comp.php.internationalization |
|---|---|
| Message-ID | <[email protected]> |
could anyone help me.
I am trying to upload a jpg file into a ms sql server 2000 database with an
image field and it's not working. This is the code so far..
$file = fopen ($HTTP_POST_FILES['upload_file']['tmp_name'],'rb')
or die ("File Open Failed "); //this is the jpg file
$file_contents = fread ($file, filesize
($HTTP_POST_FILES['upload_file']['tmp_name']))
or die (" Can't read ");
fclose ($file);
//put file in database
mssql_connect(HOST,USER,PASS) or die("unable to connect");
mssql_select_db(PICTURE_DBASE) or die("unable to select database");
//file data is the image field in the table files
mssql_query($SQL="Insert into files (file_data) values ('$file_contents')")
or die("MSSQL Query error: ". "<br><br>" );
I got all sort of error messages from ms sql
any ideas.
thanks a lot
csr.
--
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php