473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

escaping a string for use with oracle

111 100+
Hi,

I just wanted to know if there is a PHP function that can escape a string for use with the Oracle database.

I am looking for something equivilant to the function addslashes().

addslashes only works with MySQL, but i need an equivilant version for Oracle.


The MySQL escape character is (\)
But the Oracle escape charater is (').
Apr 1 '08 #1
4 7717
Markus
6,050 Expert 4TB
Hi,

I just wanted to know if there is a PHP function that can escape a string for use with the Oracle database.

I am looking for something equivilant to the function addslashes().

addslashes only works with MySQL, but i need an equivilant version for Oracle.


The MySQL escape character is (\)
But the Oracle escape charater is (').
You may be better off asking in the oracle forum

Regards.
Apr 1 '08 #2
nitinpatel1117
111 100+
Thanks markusn00b,

But, i'm looking for a PHP function that does this, i.e. escapes the sql query, before it is passed to oracle.
Apr 1 '08 #3
Markus
6,050 Expert 4TB
Thanks markusn00b,

But, i'm looking for a PHP function that does this, i.e. escapes the sql query, before it is passed to oracle.
Well, i dont work with oracle.
But what needs to be done to cleanse the input?

Regards.
Apr 1 '08 #4
nitinpatel1117
111 100+
For example, lets say i have the following code

[PHP]$str = "O'reilly?";
echo addslashes($str);[/PHP]

Output: O\'reilly?

This is fine for MySQL, but apparantly not for Oracle.

I think for it to work on oracle it needs to be outputed as
O''reilly?


I was just wondering if there is a built in function in PHP that accomodates for this, in the same way that it is accomodated for MySQL via the addslashes() function.

thanks,
Apr 1 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Dave Moore | last post by:
Hi All, Can anybody point me to a FAQ or similar that describes what all this stuff is about please?. I'm interfacing with a MySQL database if that's relavent. I've read a couple of books which...
14
by: Ian Rastall | last post by:
Sorry for the double question. I'm having a terrible time figuring out how to escape apostrophes in my mySQL database. Perhaps they have to be escaped in the PHP, using mysql_real_escape_string? ...
5
by: Henry | last post by:
I have this simple code, string escaped = Regex.Escape( @"`~!@#$%^&*()_=+{}\|;:',<.>/?" + "\"" ); string input = @"a&+" + "\"" + @"@(-d)\e"; Regex re = new Regex( string.Format(@"(+)", escaped),...
11
by: Geoff Caplan | last post by:
Hi folks, The thread on injection attacks was very instructive, but seemed to run out of steam at an interesting point. Now you guys have kindly educated me about the real nature of the issues,...
3
by: Taras_96 | last post by:
Hi everyone, I'm having a bit of trouble understanding the purpose of escaping nulls, and the use of addcslashes. Firstly, the manual states that: "Strictly speaking, MySQL requires only...
3
by: Greg R. Broderick | last post by:
Y'all: I am needing some way, in the SQL Server dialect of SQL, to escape unicode code points that are embedded within an nvarchar string in a SQL script, e.g. in Java I can do: String str =...
3
by: placid | last post by:
Hi All, I have these files; which are Merge Request (ClearCase) files that are created by a Perl CGI script (being re-written in Python, as the HTML/ JavaScript have been mixed with Perl,...
7
by: wannymahoots | last post by:
optparse seems to be escaping control characters that I pass as arguments on the command line. Is this a bug? Am I missing something? Can this be prevented, or worked around? This behaviour...
23
by: Fred | last post by:
if I use mysql_real_escape_string on all INSERT or UPDATE queries, then would a stored procedure provide any extra protection? the user has to be granted UPDATE and/or INSERT privileges anyway. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.