Welcome Guest, Not a member yet? Register   Sign In
Problem with "db->get"

Hello all!,

I am new with CI, and I'm writing my first program.
I'm try connect to sql server 2008, and I'm connecting via odbc and
I have in my database.php following:

$db['default']['hostname'] = 'DRIVER={SQL Server};SERVER=;DATABASE=CP';
$db['default']['username'] = 'Operador';
$db['default']['password'] = 'pe7878';
$db['default']['database'] = 'CP';
$db['default']['dbdriver'] = 'odbc';

but i'm getting the following error:

"A Database Error Occurred
Error Number: 37000
[Microsoft][ODBC SQL Server Driver][SQL Server]Sintaxis incorrecta cerca de ')'.
SELECT * FROM (cerepuertos)
Filename: T:\xampp\htdocs\AcopioCI\system\database\DB_driver.php
Line Number: 330"

which may be the cause?
I appreciate any suggestion,

best regards,


[eluser]Harold Villacorte[/eluser]
The config hostname is the hostame of the sql server. Try 'localhost.'


The only solution I found was to add the following lines of code to db_driver.php.

IF (substr_count($sql,"INSERT")==0)
$arr = array("(", ")");
if anyone any better solution, I'll be grateful to receive,
Best Regards


Theme © iAndrew 2016 - Forum software by © MyBB