CI ODBC driver adding round brackets around table names

#1
[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:

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.


Messages In This Thread
CI ODBC driver adding round brackets around table names - by El Forum - 04-27-2010, 08:47 PM
CI ODBC driver adding round brackets around table names - by El Forum - 10-23-2010, 01:41 AM
CI ODBC driver adding round brackets around table names - by El Forum - 02-01-2011, 12:56 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.