Hello CC,
On 26 Jan 2004 at 12:47, C C wrote:
Hi,
I'm trying to insert binary data into a MS SQL Server database. Text
files are added fine, but binary files with null bytes are not. The
field I'm adding the binary data to is image type. I get an error about
unclosed quotation marks at the null byte, but I've replaced ' with ''.
I tried escaping the null byte with a backslach, but it just changes it
to the string "\0" when I download it.
Anyone have any ideas about this?
I don't have any experience with MS SQL, but imagine that escaping the input properly is crucial. Have you tried using mysql_escape_string? Contrary to what the name of the function suggests, it can be used to escape strings (even strings of binary data) for insertion in databases other than MySQL. The prototype of the function is:
STRING mysql_escape_string ( STRING unescaped_string )
My suggestion is that you try running your input through mysql_escape_string *only* and see if it does the trick. If you do that, please let me (us) know the results; I'm curious.
Cheers,
Erik
I don't think a php function for MySQL is going to help him with binary data that he's inserting into MSSQL.
OP, what bridge are you using?
-- By-Tor.com It's all about the Rush http://www.by-tor.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php