How to insert result of mysql_real_escape_string() into oracle database?

Posted by Prat on Stack Overflow See other posts from Stack Overflow or by Prat
Published on 2012-03-29T11:27:36Z Indexed on 2012/03/29 11:29 UTC
Read the original article Hit count: 152

Filed under:
|
|
|
|

For inserting special characters in data like (,')etc., I am using musql_real_escape_string() function & it's working fine.

Now I want to use same variable while inserting values in Oracle.

$str = 'N.G.Palace\'s Building',
    'xyzcity', '12345678','India','100001',12

Here $str is result of mysql_real_escape_string(). so it escapes special character. Now my code for oracle is like this-:

 $qry ="INSERT INTO Ora_table(ship_to_street, ship_to_city,ship_to_country, ship_to_telephone, order_id, record_no) VALUES(".$str);

So my doubt is Oracle is not accepting values return by mysql_real_escape_string i.e. Palace\'s (like this as this mysql function attach \ before 'single quote)? So can anybody tell me ho9w can I use that variable $str to insert data into Oracle?

Also I tried like this also-:

"q"."'"."c".$str."c"."'"

can we use this for multiple values like in my case...though still I am unable to inser data in oracle?

plz help.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about Oracle