I was working with mysql with wamp and my coworker decided to work in mssql (I know bad communications but that's another story). We are at the point where I need my end to talk to his and we are having trouble with the connection.
His Stuff
Code:
try
{
$conn = new PDO('sqlsrv:Server=192.168.1.1; Database=DBName',NULL, NULL);
$conn ->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch(PDOException $ex)
{
die( 'Error connecting to SQL Server: '.$ex.'.');
}
echo 'connected to SQL Server\n';
My Stuff trying to connect to his
Code:
$db['default'] = array(
'dsn' => '',
'hostname' => '192.168.1.1',
'username' => '',
'password' => '',
'database' => 'DBName',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'compress' => FALSE,
'encrypt' => FALSE,
'stricton' => FALSE,
'failover' => array()
);
using his stuff on his test page, things connect but as I add his DB calls to my codeigniter page, things breaks. So we know the server is talking to my computer but I am using it wrong with codeigniter. please help.
I get error 42s02/208
[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid Object Name 'tbl_test'.
SELECT * FROM tbl_test