repost here...I hope there is SOMEBODY realy able to answer me.
I am sincerely asking for help,
I was stuck with Microsoft Access Database (also ODBC)
My aim is to save binary data via SQL query
My problem is error appear while execute this query
INSERT INTO test (data) VALUES ( some_binary_data)'
some_binary_data (30kb) is binary string that gets from file_get_contents ('somepicture.jpg').
The Data field is BLOB, I am using MySQL database and connect using MySQL ODBC driver.
No problem to insert data if the query is text base
The error code is
PHP Warning: No unicode translation available for the specified string in D:\Inetpub\projects\rfc\inc\ado.php on line 39 PHP Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft OLE DB Provider for ODBC Drivers Description: [MySQL][ODBC 3.51 Driver][mysqld-3.23.52-nt]You have an error in your SQL syntax near ''ÿ' at line 1 in D:\Inetpub\projects\rfc\inc\ado.php on line 39
What I already tried were:
Using addslashes() to escape the binary string
Fail, because it seems that, they are using quotes to escape, not slashes.
Using mb_convert_encoding() to convert string to ASCII,UTF-8
Fail, I did not expect this to work
Using COM (ADOD😎 to execute the query string method,
Im using Access database at that time, the Data field is OLE (image)
- Still same, the error appear.
Using PHP's Unified ODBC functions to query
- still fail.
Using str_replace() in PHP to replace '-> ''
- Fail
What I do not wish to use
- Method that other then using ODBC driver or ADODB.
- Using COM (CMD, ADODB.Command) to execute query
(I found this method on MSDN,I don't like it, what I needs is flexible SQL query)
The final questions is
How to escape those characters?
How many characters there are?
Any other method?