Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

(click on this box to dismiss)

How do I escape strings in PHP to pass binary data to a table via an insert or update statement ?

This is on the back of my previous question, it would be important for Cubrid to have a similar function to  mysql_escape_string for passing of binary information to an SQL statement.

How should I do this in the interim, I have already done the normal replace single quotes with double single quotes.

link comment (3)
asked 4 years ago
If the following answer answers your question, please accept it. Otherwise, let us know more in the comments. - [Level:8]CUBRID 4 years ago
I have a problem, I get back a blank result for some strings that I pass to cubrid_real_escape_string, this is a bit of a gray area as I do not know what the rules are about which text I can pass and which text I cannot. If I pass and image contents using this method the insert does not work as I get a blank return, An easy test is to try insert an image into a blob field escaping the data with cubrid_real_escape_string, the insert fails. - [Level:2]andrevanzuydam 4 years ago
Why do you need to escape binary data? - [Level:8]CUBRID 4 years ago
89 Answers

mysql_escape_string() function has been deprecated as of PHP 5.3. mysql_real_escape_string() should be used instead.

In CUBRID PHP API there is a compatible cubrid_real_escape_string() function to escape strings. You can use it.

link comment (0)
answered 4 years ago

You are either using a very old browser or a browser that is not supported.
In order to browse you need to have one of the following browsers:

Internet Explorer: Mozilla Firefox: Google Chrome: