PHP on win32 with IIS and MSSQL 2000

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Static
Forum Newbie
Posts: 3
Joined: Fri Jan 10, 2003 3:57 am
Location: United Kingdon

PHP on win32 with IIS and MSSQL 2000

Post by Static »

I am trying to recode a web site I have from ASP to PHP. Firstly i want to get a connection to the underlying SQL database.

When executing the code below in a php script i get a message in the browser "No input file specified". I found a few topics relating to the --enable discard path etc etc but this only seems to be based on Linux systems?

<?php

$myServer = "localhost";
$myUser = "sa";
$myPass = "";
$myDB = "ooh_webcontent";

$s = @mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");

$d = @mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");

?>

Please can someone help?
ABoutAGirl
Forum Newbie
Posts: 1
Joined: Fri Jan 10, 2003 8:23 am

Did you enable "mssql.so" or "mssql.dll"

Post by ABoutAGirl »

May be you didn't ^^
Static
Forum Newbie
Posts: 3
Joined: Fri Jan 10, 2003 3:57 am
Location: United Kingdon

Post by Static »

I have enabled the php_mssql.dll extenstion in the php.ini file. The location of the dll file is in c:\php and that is also set as the extensions directory in the php.ini
User avatar
caseymanus
Forum Commoner
Posts: 34
Joined: Wed Nov 20, 2002 10:32 pm
Contact:

Post by caseymanus »

The PHP mssql functions do not work with SQL Server 2000, only SQL Server 7.0 and earlier....Use the unified ODBC functions and drivers.
glo-wurm
Forum Newbie
Posts: 13
Joined: Mon Jan 13, 2003 2:07 pm
Location: Naples, FL

Post by glo-wurm »

... or, you could try using the PEAR DB API for accessing mssql. From what I understand, the version of PEAR packaged with PHP v4.3 is considered stable on unix platforms, and in final beta stages for win32 and Darwin platforms. Give it a shot and see if it works.

here is the url to the PEAR DB API documentation:

http://pear.php.net/manual/en/core.db.php

Hope this helps :D
Static
Forum Newbie
Posts: 3
Joined: Fri Jan 10, 2003 3:57 am
Location: United Kingdon

Thanks for all your help

Post by Static »

I have managed to fix the problem mainly by fluke. I am now able to use the mssql function without problem. It seems to work correctly on sql2k.

Cheers,


Static :)
Post Reply