mssql";
$db = mssql_connect('JAGUAR\vsdotnet','adodb','natsoft') or die('No Connection');
mssql_select_db('northwind',$db);
$rs = mssql_query('select getdate() as date',$db);
$o = mssql_fetch_row($rs);
print_r($o);
mssql_free_result($rs);
print "
Delete
"; flush();
$rs2 = mssql_query('delete from adoxyz',$db);
$p = mssql_num_rows($rs2);
mssql_free_result($rs2);
}
function tpear()
{
include_once('DB.php');
print "PEAR
";
$username = 'adodb';
$password = 'natsoft';
$hostname = 'JAGUAR\vsdotnet';
$databasename = 'northwind';
$dsn = "mssql://$username:$password@$hostname/$databasename";
$conn = DB::connect($dsn);
print "date=".$conn->GetOne('select getdate()')."
";
@$conn->query('create table tester (id integer)');
print "Delete
"; flush();
$rs = $conn->query('delete from tester');
print "date=".$conn->GetOne('select getdate()')."
";
}
function tadodb()
{
include_once('../adodb.inc.php');
print "ADOdb
";
$conn = NewADOConnection('mssql');
$conn->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
// $conn->debug=1;
print "date=".$conn->GetOne('select getdate()')."
";
$conn->Execute('create table tester (id integer)');
print "Delete
"; flush();
$rs = $conn->Execute('delete from tester');
print "date=".$conn->GetOne('select getdate()')."
";
}
$ACCEPTIP = '127.0.0.1';
$remote = $_SERVER["REMOTE_ADDR"];
if (!empty($ACCEPTIP))
if ($remote != '127.0.0.1' && $remote != $ACCEPTIP)
die("Unauthorised client: '$remote'");
?>
mssql
pear
adodb