[freetds] connecting MSSQL Server from linux+php
Venkatraman M Srinivasan
mlmsrini at lycos.com
Wed Jul 2 12:11:36 EDT 2003
Hi
Hi everyone
This is regarding MSSQL Server connectivity with PHP which is running on Red Hat Linux.
Before that i would like to thank Arnar for helping me on this.
Ok...this is what i did.
configured freetds0.61 under /usr/local like this
./configure --with-tdsver=7.0 --enable-msdblib
then compiled PHP with
./configure --with-apache=../apache_1.3.12 --with-mysql=/usr/local/mysql --with-mssql=/usr/local/freetds --enable-memory-limit=yes --enable-track-vars
make
make install
Restarted the Apache.
I edited the freetds.conf file from usr/local/freetds and did this
[MyServer70]
host = 192.168.4.45 // MSSQL Server IP address
port = 1433
tds version = 7.0
After that i 've tested for the MSSQL server connectivity with a sample php code.
<?
// connectivity testing
putenv("TDSVER=70");
$conn = mssql_connect("MyServer70",$user,$passwd)
or die("Connection to MSSQL SERVER failed");
$query=mssql_query("select product_name,product_price from products",$conn);
while ($row=mssql_fetch_array($query)){
$product=$row["product_name"];
echo ("Product - ".$product."<br>");
}
?>
But i could n't connect to MSSQL Server and getting the following error.
Fatal error: Call to undefined function: mssql_connect() in /home/httpd/test/test.php on line 4
I don't know what i am doing wrong here. I 've been struggling with this for the past 2 days.
I am very urgently need this help.
Thanks in advance.
svan
____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005
More information about the FreeTDS
mailing list