04-27-2010, 08:47 PM
[eluser]Andy Chapman[/eluser]
Hi all, I'm using CI's odbc driver to connect to SQL Server (from unix using FreeTDS).
When I run a select statement like this:
I get a database error like this:
Error Number: 37000
[unixODBC][FreeTDS][SQL Server]Incorrect syntax near ')'.
SELECT * FROM (USERS) WHERE WEB_USERNAME = 'harry' AND WEB_PASSWORD = 'secret'
If I manually remove the round brackets from the table name it works fine. I can also change the round brackets to square brackets and it works fine.
Any thoughts?
I'm using CI 1.7.2
Thanks in advance.
Hi all, I'm using CI's odbc driver to connect to SQL Server (from unix using FreeTDS).
When I run a select statement like this:
Code:
$this->db->select('*');
$this->db->from('USERS');
$this->db->where('WEB_USERNAME', $username);
$this->db->where('WEB_PASSWORD', $password);
$query = $this->db->get();
I get a database error like this:
Error Number: 37000
[unixODBC][FreeTDS][SQL Server]Incorrect syntax near ')'.
SELECT * FROM (USERS) WHERE WEB_USERNAME = 'harry' AND WEB_PASSWORD = 'secret'
If I manually remove the round brackets from the table name it works fine. I can also change the round brackets to square brackets and it works fine.
Any thoughts?
I'm using CI 1.7.2
Thanks in advance.