Is there a function similar to mysql_real_escape_string for php's sqlsrv library?
11,445
I would recommend to use an abstraction layer like http://php.net/pdo, http://www.doctrine-project.org/ or http://www.propelorm.org/
With pdo for example you can use http://php.net/manual/en/pdo.quote.php
Comments
-
Conner almost 2 years
I'm am looking for a function similar to
mysql_real_escape_string
for the SQLSRV library.Specifically I'm having difficulties escaping single quotation marks. Instead of escaping with a
"\"
like in mysql you use a single quote in front of the other single quote as the escape method.I'm working on coming up with a solution of my own using
preg_replace
but was just wondering if there was something else out there I was missing.