Welcome Guest, Not a member yet? Register   Sign In
I could not connect to MSSQLSERVER 2012
#11

[eluser]huangxiao[/eluser]
Hi, dbvend is the name of my database that i created in MSSQLSERVER,okay i will try your post.by the way why is it that the database is "sqlsrv"?
#12

[eluser]huangxiao[/eluser]
[quote author="jonez" date="1395929749"]One of these lines is incorrect:
Code:
$db[‘default’][‘hostname’] = ‘127.0.0.1’; // should be your local address
$db[‘default’][‘username’] = ‘sa’; // confirm username
$db[‘default’][‘password’] = ‘’; // confirm password
$db[‘default’][‘database’] = ‘sqlsrv’; // not sure what dbvend is?
[/quote]


Hi i tried to change to 127.0.0.1,but still same error i could not connect.


Thank you in advance.
#13

[eluser]jonez[/eluser]
Sorry I made a mistake above! I set your database to the driver, it should be this:
Code:
$db['default']['hostname'] = '127.0.0.1'; // can also try localhost
$db['default']['username'] = ''; // the user you want to connect as
$db['default']['password'] = ''; // the password for that user
$db['default']['database'] = ''; // the database name that contains your tables
$db['default']['dbdriver'] = 'sqlsrv';
#14

[eluser]huangxiao[/eluser]
by the way how do you put username and password to the msssql server database example mine is dbvend how do i put usenrame and password so that i can supply properly to the CI config..


Thank you in advance.
#15

[eluser]huangxiao[/eluser]
[quote author="jonez" date="1395934658"]Sorry I made a mistake above! I set your database to the driver, it should be this:
Code:
$db['default']['hostname'] = '127.0.0.1'; // can also try localhost
$db['default']['username'] = ''; // the user you want to connect as
$db['default']['password'] = ''; // the password for that user
$db['default']['database'] = ''; // the database name that contains your tables
$db['default']['dbdriver'] = 'sqlsrv';
[/quote]


By the way is this applicable to all version of Php and apatache in connecting CI to MSSQLServer?


Thank you.
#16

[eluser]jonez[/eluser]
Yes that is how you configure a database connection in CI. It should work with any version of PHP, I think 2.1.7 supports up to 5.4 or 5.5? There are some changes in CI3 that work better with 5.6+.




Theme © iAndrew 2016 - Forum software by © MyBB