[eluser]Tim Brownlaw[/eluser]
[quote author="huangxiao" date="1398822254"]Hi,
I put this in database.php
Code:
$server = 'XIAO-PC\SQLEXPRESS2012';
$connectionInfo = array( "Database"=>"msdb", "UID"=>"admin", "PWD"=>"admin");
$conn = sqlsrv_connect( $server, $connectionInfo);
<snip>
and it says connected.[/quote]
That's good, as it means its all setup for PHP to play with.
Ok so you can dig down into the sqlsrv driver under /system/database/drivers/sqlsrv_driver.php and check out the db_connect method...
In the /config/database.php you would have...
Code:
...
$db['default']['hostname'] = 'XIAO-PC\SQLEXPRESS2012';
$db['default']['username'] = 'admin';
$db['default']['password'] = 'admin';
$db['default']['database'] = 'msdb';
$db['default']['dbdriver'] = 'sqlsrv';
$db['default']['dbprefix'] = ''; // If you have one set...
$db['default']['pconnect'] = TRUE; // If you want a persistent connection
...
Now I've never used or intend to use a MS anything... so I'm only working back from what info you have provided and what a little digging has come up with...
See how that flies but there's no guarantees with this...
Cheers
Tim