Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/vendor/adodb/adodb-php/tests/tmssql.php
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
commit6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch)
tree350feb504587d932e02837a1442b059759927646 /vendor/adodb/adodb-php/tests/tmssql.php
initial checkin
Diffstat (limited to 'vendor/adodb/adodb-php/tests/tmssql.php')
-rw-r--r--vendor/adodb/adodb-php/tests/tmssql.php79
1 files changed, 79 insertions, 0 deletions
diff --git a/vendor/adodb/adodb-php/tests/tmssql.php b/vendor/adodb/adodb-php/tests/tmssql.php
new file mode 100644
index 0000000..0f81311
--- /dev/null
+++ b/vendor/adodb/adodb-php/tests/tmssql.php
@@ -0,0 +1,79 @@
+<?php
+error_reporting(E_ALL);
+ini_set('mssql.datetimeconvert',0);
+
+function tmssql()
+{
+ print "<h3>mssql</h3>";
+ $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 "<p>Delete</p>"; flush();
+ $rs2 = mssql_query('delete from adoxyz',$db);
+ $p = mssql_num_rows($rs2);
+ mssql_free_result($rs2);
+
+}
+
+function tpear()
+{
+include_once('DB.php');
+
+ print "<h3>PEAR</h3>";
+ $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()')."<br>";
+ @$conn->query('create table tester (id integer)');
+ print "<p>Delete</p>"; flush();
+ $rs = $conn->query('delete from tester');
+ print "date=".$conn->GetOne('select getdate()')."<br>";
+}
+
+function tadodb()
+{
+include_once('../adodb.inc.php');
+
+ print "<h3>ADOdb</h3>";
+ $conn = NewADOConnection('mssql');
+ $conn->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
+// $conn->debug=1;
+ print "date=".$conn->GetOne('select getdate()')."<br>";
+ $conn->Execute('create table tester (id integer)');
+ print "<p>Delete</p>"; flush();
+ $rs = $conn->Execute('delete from tester');
+ print "date=".$conn->GetOne('select getdate()')."<br>";
+}
+
+
+$ACCEPTIP = '127.0.0.1';
+
+$remote = $_SERVER["REMOTE_ADDR"];
+
+if (!empty($ACCEPTIP))
+ if ($remote != '127.0.0.1' && $remote != $ACCEPTIP)
+ die("Unauthorised client: '$remote'");
+
+?>
+<a href=tmssql.php?do=tmssql>mssql</a>
+<a href=tmssql.php?do=tpear>pear</a>
+<a href=tmssql.php?do=tadodb>adodb</a>
+<?php
+if (!empty($_GET['do'])) {
+ $do = $_GET['do'];
+ switch($do) {
+ case 'tpear':
+ case 'tadodb':
+ case 'tmssql':
+ $do();
+ }
+}