Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: g00s3m4n on January 05, 2006, 01:48:07 PM
-
Hello..
I am looking to connect to and query a mssql database from a PHP page running on my SME 6.01 server. I have installed all updates and updated my PHP version to 4.4.1 (thanks to Ergin's script)
I get the following error in my messages log:
httpd: PHP Fatal error: Call to undefined function: mssql_connect() in /home/e-smith/files/ibays/Primary/html/test.php on line 5
I have trawled the forums looking for help and what I have found is that supposedly I am to install sybase support from http://rpms.arvin.dk/php, the problem is that it is for the wrong version..
All I need want to do it setup a simple page with 3 tables that will query the mssql db for the vales..
can anyone steer me in the right direction?
thanks
-
See here,
http://webmonkey.wired.com/webmonkey/99/21/index2a_page6.html?tw=programming
If you dont get it, review all the lessons..
-Ruwan
-
thanks for the reply... but that appears to be for mysql and not mssql
-
Hi g00s3m4n,
By far the easiest method of connecting to MS-SQL from an sme box is to use unixODBC.
I have successfully done this (Remarkably easily) on SME7, but the method should be virtually identical on 6.
You need to install unixODBC, and the php-odbc extension (Ergins script installs both - I think)
You then need to install freeTDS...
visit http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/redhat/RPMS/ and download the main, and unixODBC rpms.
Copy them to your SME and install them both.
Now you just need to create/modify freetds.conf odbcinst.ini & odbc.ini
If you want help doing this, let me know :)
-
I've now completed an MSSQL howto:
Please see http://forums.contribs.org/index.php?topic=30342.0