Possible Duplicate:
How to escape strings in MSSQL using PHP?
I am making a system and I need to prevent SQL injection. I’m using PHP and SQL Server 2008 R2. Basically what I’m wondering is if I can just use:
mysql_real_escape_string
or is there a specific one for SQL Server. Any feedback appreciated.
I would suggest start using PDO. this way you could use parametrized query which will take care of almost everything for you including SQL injection plus it supports a very large RDBMS including MSSQL.
Here are some of the topic to get you started.
http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/
http://www.php.net/manual/en/book.pdo.php