Do Not Think!!!

Posted
Filed under 01010101

1. Install FreeTDS and the PHP MS SQL extension

2. Configure FreeTDS

3. Test FreeTDS using server name

4. Confiure Codeigniter






1. Install FreeTDS and the PHP MS SQL extension

[CODE]$ sudo apt-get install freetds-common freetds-bin php5-sybase[/CODE]
php5-sybase: This package provides a module for Sybase and Microsoft SQL Server
database connections directly from PHP scripts.


2. Configure FreeTDS

[CODE]$ vi /etc/freetds/freetds.conf

[yourserver]
host = your.server.name
port = 1433
tds version = 8.0[/CODE]


3. Test FreeTDS using server name

[CODE]$ tsql -S yourserver -U username -D databasename[/CODE]


4. Confiure Codeigniter

[CODE]$db['default']['hostname'] = 'yourserver';
$db['default']['username'] = 'username';
$db['default']['password'] = 'password';
$db['default']['database'] = 'databasename';
$db['default']['dbdriver'] = 'mssql';[/CODE]