lilyyan
asked on
is there a similar function: mysql_real_escape_string () for ms sql server
hello:
is there a similar function: mysql_real_escape_string () for ms sql server?
thank so much you for your reply!
is there a similar function: mysql_real_escape_string () for ms sql server?
thank so much you for your reply!
No. You will need to write you own.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you all so much!
q1: from this link: http://www.w3schools.com/php/func_string_addslashes.asp:
it says runs addslashes() on all GET, POST, and COOKIE data by default. so i don't need excape the single quote
q2: in ths code snippet:
q1: from this link: http://www.w3schools.com/php/func_string_addslashes.asp:
it says runs addslashes() on all GET, POST, and COOKIE data by default. so i don't need excape the single quote
q2: in ths code snippet:
str_replace("'", "''", $data)
why it's not: str_replace("'", "\'", $data)?
thank you so much!
ASKER
sorry, q2 should be
why it's not: str_replace("'", "\\'", $data)?
q1: from this link: http://www.w3schools.com/php/func_string_addslashes.asp:
it says php runs addslashes() on all GET, POST, and COOKIE data by default. so i don't need excape the single quote?
thank you so much!
why it's not: str_replace("'", "\\'", $data)?
q1: from this link: http://www.w3schools.com/php/func_string_addslashes.asp:
it says php runs addslashes() on all GET, POST, and COOKIE data by default. so i don't need excape the single quote?
thank you so much!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great, thanks so much!
how about excape double " ? in MS SQL-Server
it will be'"
right?
how about excape double " ? in MS SQL-Server
it will be'"
right?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
well, from this link http://www.w3schools.com/php/func_string_addslashes.asp.
the double quotes need to be escaped... it's " not'' // please the code snippet
would you please exaplain a little bit : the special meaning of single quote ' in sql.
i thought it is the same as a " (double quote )
the double quotes need to be escaped... it's " not'' // please the code snippet
would you please exaplain a little bit : the special meaning of single quote ' in sql.
i thought it is the same as a " (double quote )
it's " not''
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.