Hello,

Does anyone know how to connect to a ms sql server from a unix platform
Below is the code i found.
I've setup the slq server and allowed it to accept remote connection. Port 1433 is open for connection and firewall is configered to allow remote connection. The host uses the php dbx_connect extension.

I just wan't to know what to fill in at the server part. I thought is was something like this.

isp ip address \ computername\ slq instance

What I've tried the outcome is the same "Could not connect" Even when i disabled the firewall!
I would be greatfull if someone can point me to the right directions how to solve this.
i need this for a project i'm working on.

Thanks, Leon

<?php
    $link = dbx_connect(DBX_MSSQL, "server", "database", "username", "password", DBX_PERSISTENT)
        or die("Could not connect");

    echo "Connected successfully";
    dbx_close($link);
    ?>

Recommended Answers

You can try if the mssql module is enabled.

Jump to Post

Is PDO disabled too? Although it may outdate PHP4...

Jump to Post

All 7 Replies

I enableded error reporting and this is the response I get

Warning: dbx: module '4' not loaded or not supported

I guess, that the webhost does not allow to make connection to sql databases other then mysql?

You can try if the mssql module is enabled.

Hello protaeas,

mssql module is not enabled!

The webhost is using php version 4.3.9.

Is PDO disabled too? Although it may outdate PHP4...

PDO is disabled too

Get a new host? The only other thing I can think of is unixODBC, but that requires installation. It is mentioned here in the comments with PHP4 even.

I was thinking the same too lookout for a new host.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.