5 * V4.50 6 July 2004 (c) 2001-2002 John Lim (jlim#natsoft.com). All rights reserved.
6 * Released under both BSD license and Lesser GPL library license.
7 Whenever there is any discrepancy between the two licenses,
8 the BSD license will take precedence.
13 // documentation on usage is at http://php.weblogs.com/adodb_csv
15 echo PHP_VERSION
,'<br>';
16 var_dump(parse_url('odbc_mssql://userserver/'));
19 include('../adodb.inc.php');
20 include('../tohtml.inc.php');
22 function send2server($url,$sql)
24 $url .= '?sql='.urlencode($sql);
26 $rs = csv2rs($url,$err);
31 function print_pre($s)
33 print "<pre>";print_r($s);print "</pre>";
37 $serverURL = 'http://localhost/php/phplens/adodb/server.php';
40 $sql1 = "insertz into products (productname) values ('testprod 1')";
41 $sql2 = "insert into products (productname) values ('testprod 1')";
42 $sql3 = "insert into products (productname) values ('testprod 2')";
43 $sql4 = "delete from products where productid>80";
44 $sql5 = 'select * from products';
47 print "<a href=#c>Client Driver Tests</a><p>";
48 print "<h3>Test Error</h3>";
49 $rs = send2server($serverURL,$sql1);
53 print "<h3>Test Insert</h3>";
55 $rs = send2server($serverURL,$sql2);
59 print "<h3>Test Insert2</h3>";
61 $rs = send2server($serverURL,$sql3);
65 print "<h3>Test Delete</h3>";
67 $rs = send2server($serverURL,$sql4);
72 print "<h3>Test Select</h3>";
73 $rs = send2server($serverURL,$sql5);
74 if ($rs) rs2html($rs);
80 print "<a name=c><h1>CLIENT Driver Tests</h1>";
81 $conn = ADONewConnection('csv');
82 $conn->Connect($serverURL);
85 print "<h3>Bad SQL</h3>";
87 $rs = $conn->Execute($sql1);
89 print "<h3>Insert SQL 1</h3>";
90 $rs = $conn->Execute($sql2);
92 print "<h3>Insert SQL 2</h3>";
93 $rs = $conn->Execute($sql3);
95 print "<h3>Select SQL</h3>";
96 $rs = $conn->Execute($sql5);
97 if ($rs) rs2html($rs);
99 print "<h3>Delete SQL</h3>";
100 $rs = $conn->Execute($sql4);
102 print "<h3>Select SQL</h3>";
103 $rs = $conn->Execute($sql5);
104 if ($rs) rs2html($rs);
107 /* EXPECTED RESULTS FOR HTTP TEST:
110 http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
114 [dataProvider] => native
130 [sql] => insert into products (productname) values ('testprod')
136 --------------------------------------------------------------------------------
139 http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
143 [dataProvider] => native
159 [sql] => insert into products (productname) values ('testprod')
165 --------------------------------------------------------------------------------
168 http://localhost/php/adodb/server.php?sql=delete+from+products+where+productid%3E80
172 [dataProvider] => native
188 [sql] => delete from products where productid>80