将ASP连接转换为PHP

I have a pre-existing ASP script that I've been tasked with converting to PHP. The connection string is like so:

$conn = new COM("ADODB.Connection");

if(strpos($_SERVER["HTTP_HOST"],"localhost")){
$conn->Open("dsn=xxxxx;uid=xxxxx;pwd=xxxxxxxx");
}elseif(strpos($_SERVER["HTTP_HOST"],"dpsql")){
$conn->Open("dsn=xxxxx;uid=xxxxx;pwd=xxxxxxxx");
}else{
$conn->Open("Provider=SQLOLEDB; Data Source=xxx.xxxxxxxxxxxx.com; Initial Catalog=xxxxxxxxxxxxxx; User ID=xxxxxxxxxx; Password=xxxxxxx;network=xxxxxxx");
}

Most of the examples I can find involve use of the PHP COM Extension however I am on a Linux hosted PHP version and was told by my Hosting Provided that the COM Extension was for windows. I've spent a couple hours trying to figure out how to create a connection object that works with all of these but I'm more front-end oriented. I tried using a PDO connection but to no avail. Any help would be greatly appreciated.

UPDATE

I've been able to connect using PDO with the sqlite driver as that's all HostGator has installed for me. Not very familiar with PDO but I'll Google around and see what I can figure out on how to use it. Currently stuck on:

$conn = $c->prepare($g_sql);
$conn->Execute();

returning erro:

Fatal error: Call to a member function Execute() on a non-object
$server = 'xxx.xxxxxxxxxxxx.com';
$conn = mssql_connect($server, 'youruserid', 'yourpassword');

Also, check this, (unless your on UNIX, in which case there's probably an equivalent procedure you have to go through

http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-the-sql-server-driver-for-php

PHP has several options that you can use to connect to a MS SQL Databse.

The best option for what you need is the COM("ADODB.Connection") class.

Try doing.

$conn = new COM("ADODB.Connection") or die("Cannot start ADO");

$conn->open("Provider=SQLOLEDB; Data Source=xxx.xxxxxxxxxxxx.com; Initial Catalog=xxxxxxxxxxxxxx; User ID=xxxxxxxxxx; Password=xxxxxxx;network=xxxxxxx");

$query = $conn->execute("SELECT field FROM table");

You can read more about it here: http://www.php.net/manual/en/class.com.php