Connection SQL 2005 express + php

Newbie Spellweaver
Joined
Sep 1, 2012
Messages
6
Reaction score
0
Hello. I have a problem with the connection SQL 2005 express + php in windows server 2008.

website hosting on IIS

PHP:
$config = array(
    'db_username' => 'sa', // database username
    'db_password' => '123456789',   // database password
    'db_dsn'      => 'kal_db',   // system DSN to the database
    'db_dsn2'      => 'kal_auth',   // system DSN to the database
    'debug'       => false,               // show SQL errors if true
);


        $conn = odbc_connect($config['db_dsn'],
                             $config['db_username'],
                             $config['db_password']);

        $conn2 = odbc_connect($config['db_dsn2'],
                             $config['db_username'],
                             $config['db_password']);

On the website there is no error but does not display information from SQL.
Are you missing me some files in php.ini? or this a problem with ports?
 
I tried different scripts and they all work the same way.
sometimes shows an error:
Fatal error: Call to undefined function mssql_connect()
 
Upvote 0
The different scripts dosent work because Call to undefined function mssql_connect() means the php_mssql.dll php extension is disabled in php.ini or missing so you must either use ODBC scripts or try to enable php_mssql extension.
 
Upvote 0
I know, but the file php.ini i dont have ;extension=php_mysql.dll. I do not know if this is due to a bad version of php? Is there a tutorial on this subject? Is there a tutorial on the installation and setup iss?
 
Upvote 0
try install latest version should work if you install.
 
Upvote 0
Bez tytułu - Connection SQL 2005 express + php - RaGEZONE Forums
I do not have this setting at all.
 
Upvote 0
as i see you using odb connection + IIS
so you have to use Driver={SQL Server} to select and connect to the database
for more info , search on google :Pp
 
Upvote 0
Ok, I worked it out already with this error but now I have another problem.
PHP:
[03-Sep-2012 20:13:52] PHP Warning:  mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: Unable to connect to server:  (null) in C:\inetpub\wwwroot\ranking.php on line 7
[03-Sep-2012 20:13:52] PHP Warning:  mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: A link to the server could not be established in C:\inetpub\wwwroot\ranking.php on line 7
[03-Sep-2012 20:13:52] PHP Warning:  mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in C:\inetpub\wwwroot\ranking.php on line 12
The connection I have set correctly. Please help, what could it be?
 
Upvote 0
Ok, I worked it out already with this error but now I have another problem.
PHP:
[03-Sep-2012 20:13:52] PHP Warning:  mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: Unable to connect to server:  (null) in C:\inetpub\wwwroot\ranking.php on line 7
[03-Sep-2012 20:13:52] PHP Warning:  mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: A link to the server could not be established in C:\inetpub\wwwroot\ranking.php on line 7
[03-Sep-2012 20:13:52] PHP Warning:  mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in C:\inetpub\wwwroot\ranking.php on line 12
The connection I have set correctly. Please help, what could it be?
its mssql connection
so the settings you added for odbc connection will not work with mssql connection
also you have to enable mssql connection in php or install it
choose the easiest way better and use odbc connection
 
Upvote 0
I would also make sure you look at your php error logs, that will show much more information. One tip I do for ease of access to all the different log files, is to create a folder on my desktop, and set in php.ini and httpd.conf to have their log files created there.

Good luck...Also depending on which version of apache/php has different mssql connection support.
 
Upvote 0
Back