FuZion
08-09-2007, 04:52 PM
Hello,
I am trying to read a Microsoft Excel file into a database.. here is the code I am using:
$svcSheetHdl = fopen($_FILES['svcSheet']['tmp_name'], "r");
$svcSheetContent = fread($svcSheetHdl, $_FILES['svcSheet']['size']);
$svcSheetContent = addslashes ( $svcSheetContent );
fclose( $svcSheetHdl );
Then I simply put $svcSheetContent in an INSERT statement and run it. Unfortunately, I don't think addslashes is working correctly. Some of the quotes within the BLOB data are being read, even though they have been escaped, or should have been. I have tried using mysql_real_escape_string() and addslashes() and neither of them work. I have used this method before with no problem whatsoever, is this something with excel files?
What should I do, any ideas?
Any help is greatly appreciated.
Thanks,
FuZion
I am trying to read a Microsoft Excel file into a database.. here is the code I am using:
$svcSheetHdl = fopen($_FILES['svcSheet']['tmp_name'], "r");
$svcSheetContent = fread($svcSheetHdl, $_FILES['svcSheet']['size']);
$svcSheetContent = addslashes ( $svcSheetContent );
fclose( $svcSheetHdl );
Then I simply put $svcSheetContent in an INSERT statement and run it. Unfortunately, I don't think addslashes is working correctly. Some of the quotes within the BLOB data are being read, even though they have been escaped, or should have been. I have tried using mysql_real_escape_string() and addslashes() and neither of them work. I have used this method before with no problem whatsoever, is this something with excel files?
What should I do, any ideas?
Any help is greatly appreciated.
Thanks,
FuZion