<?php

phpinfo();

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

/*
PHP MSSQL Example

Replace data_source_name with the name of your data source.
Replace database_username and database_password
with the SQL Server database username and password.
*/
$data_source='109.170.187.112:c:\applics\asm\ASMLIVE.gdb';
$user='OPERATOR';
$password='rotarepo';

// Connect to the data source and get a handle for that connection.
$conn=odbc_connect($data_source,$user,$password);
if (!$conn){
    if (phpversion() < '4.0'){
      exit("Connection Failed: . $php_errormsg" );
    }
    else{
      exit("Connection Failed:" . odbc_errormsg() );
    }
}
else
{
	echo 'connected';
}

// This query generates a result set with one record in it.
/*$sql="SELECT 1 AS test_col";*/

# Execute the statement.
/*$rs=odbc_exec($conn,$sql);*/

// Fetch and display the result set value.
/*if (!$rs){
    exit("Error in SQL");
}
while (odbc_fetch_row($rs)){
    $col1=odbc_result($rs, "test_col");
    echo "$col1\n";
}*/

// Disconnect the database from the database handle.
/*odbc_close($conn);*/
?>