Welcome Guest, Not a member yet? Register   Sign In
mssql 2008 with PHP 5.3.2 and CI 1.7.2
#1

[eluser]Russell Keith[/eluser]
I have a brand new Windows 2008 R2 server running IIS7, PHP 5.3.2, MSSQL 2008, and CI 1.7.2. Can someone point me in the right direction to get the MSSQL database setup to connect? I have always used MySQL and can't get MSSQL to work at all. When I load the database class I get a lovely nondescript 500 error from IIS, when I turn the database class off the welcome page loads just fine.
#2

[eluser]Mareshal[/eluser]
I think this would help you: http://ryonsherman.blogspot.com/2009/05/...y-for.html

Bye the way, If I were you I would go for MySQL. And, why don't you use XAMPP on windows? It has 5.3.2 Smile
#3

[eluser]Russell Keith[/eluser]
My hand is being forced by a network manager that refuses anything that is not M$. So IIS and MSSQL it is for me, yeah!!!
#4

[eluser]Russell Keith[/eluser]
[quote author="Mareshal" date="1277373357"]I think this would help you: http://ryonsherman.blogspot.com/2009/05/...y-for.html[/quote]

This only talks about using the Extended Properties library he created, I need help getting it to work first, but it is very interesting and will keep it bookmarked for the day I get this crap working.
#5

[eluser]flaky[/eluser]
I just did a test setup to test IIS + CodeIgniter 1.7.2 + MSSQL 2008 and it worked. Can you put the database.php file here, just to check.
#6

[eluser]Russell Keith[/eluser]
[quote author="flaky" date="1277385309"]I just did a test setup to test IIS + CodeIgniter 1.7.2 + MSSQL 2008 and it worked. Can you put the database.php file here, just to check.[/quote]

I have tried a couple of things, can you post your that works? I won't be able to get to mine for a few hours.
#7

[eluser]flaky[/eluser]
Code:
$db['default']['hostname'] = "FLAKRONBYTYQI\SQL2008";
$db['default']['username'] = "sa";
$db['default']['password'] = "sa";
$db['default']['database'] = "Gallery";
$db['default']['dbdriver'] = "mssql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
#8

[eluser]Russell Keith[/eluser]
i didn't use server\sql2008, i was just using server as the hostname.
#9

[eluser]flaky[/eluser]
Code:
SQL2008
is my sql server instance, because I have several sql server versions installed (including sql2005)
#10

[eluser]Russell Keith[/eluser]
ok I got this working as stand alone code.
Code:
$serverName = "(local)";
$connectionOptions = array("Database"=>"CI_Test", "UID"=>"test", "PWD"=>"test");
$conn = sqlsrv_connect( $serverName, $connectionOptions);
if( $conn === false )
    { die( FormatErrors( sqlsrv_errors() ) ); }

But my CI still isn't working. I tried the host name two ways.

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "GIZMO\MSSQLSERVER";
-or-
$db['default']['hostname'] = "GIZMO";

$db['default']['username'] = "test";
$db['default']['password'] = "test";
$db['default']['database'] = "CI_Test";
$db['default']['dbdriver'] = "mssql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";




Theme © iAndrew 2016 - Forum software by © MyBB