Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem in connecting php with mssql

Status
Not open for further replies.

meenakshidhar

Programmer
Oct 19, 2001
77
MY
I m using PHP with MSSQL...i have installed FREETDS in my linux box...MSSQL 2000 is on WIN2000 machine..on my linux box i m already using PHP and MYSQL...which is working fine...but i m not abble to connect to MSSQL using PHP...
my code is as follows..
<?
$msconnect=mssql_connect(&quot;serverip&quot;,&quot;username&quot;,&quot;pass&quot;) or die(&quot;could not connect server&quot;);
$msdb=mssql_select_db(&quot;dbname&quot;,$msconnect);
$msquery = &quot;select * from tablename&quot;;
$msresults= mssql_query($msquery);
while ($row = mssql_fetch_array($msresults)) {
echo &quot;<li>&quot; . $row['fieldname']. &quot;</li>\n&quot;;
}
?>
the error which i m getting is--
Fatal error: Call to undefined function: mssql_connect() in /var/ on line 3

is there anything i m missing...i want to use mysql and mssql both with php...
urgent help needed...

Regards
Meenakshi Dhar
 
According to the error, this is a PHP problem, it has not the module compiled or it is missing.

From
Installation

The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini.

To get these functions to work, you have to compile PHP with
Code:
--with-mssql[=DIR]
, where DIR is the FreeTDS install prefix. And FreeTDS should be compiled using --enable-msdblib.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top