CodeIgniter/codeigniter — Issue #1: sqlsrv doesn't escape the queries properly
Author: Loupax
Created: 2011-11-22 13:18:05+00:00
State: open

I'm creating a web app in CodeIgniter, and we must use an MS SQL server, and I realised that when I run the following query it throws me an error.

$this->db->insert("User",array('name'=>'CI Wonder'));

[Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'User'.

INSERT INTO User (name) VALUES ('CI Wonder')

If I put quotes inside of the quotes it works just fine :)