Do Not Think!!!

Posted
Filed under 01010101
Install Microsoft SQL Server database connection module
[CODE]$ sudo apt-get install php5-sybase
$ sudo /etc/init.d/apache2 restart[/CODE]


Edit freetds.conf
[CODE]$ sudo vi /etc/freetds/freetds.conf
# A typical Microsoft server
[egServer70]
    host = sqlserver_hostname
    port = 1433
    tds version = 7.0 [/CODE]


Edit CodeIgniter config/database.php
[CODE]$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'egServer70';
$db['default']['username'] = 'USERNAAME';
$db['default']['password'] = 'PASSWORD';
$db['default']['database'] = 'DATABASE';
$db['default']['dbdriver'] = 'mssql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;[/CODE]


CodeIgniter Code
[CODE]$this->load->database();

$query = $this->db->select('*')
    ->from('table')
    ->limit(1)
    ->get();
$row = $query->row_object();
print_r($row);[/CODE]