00001 <html>
00002 <body bgcolor=white>
00003 <?php
00013
00014
00015 echo PHP_VERSION,'<br>';
00016 var_dump(parse_url('odbc_mssql:
00017 die();
00018
00019 include('../adodb.inc.php');
00020 include('../tohtml.inc.php');
00021
00022 function &send2server($url,$sql)
00023 {
00024 $url .= '?sql='.urlencode($sql);
00025 print "<p>$url</p>";
00026 $rs = csv2rs($url,$err);
00027 if ($err) print $err;
00028 return $rs;
00029 }
00030
00031 function print_pre($s)
00032 {
00033 print "<pre>";print_r($s);print "</pre>";
00034 }
00035
00036
00037 $serverURL = 'http:
00038 $testhttp = false;
00039
00040 $sql1 = "insertz into products (productname) values ('testprod 1')";
00041 $sql2 = "insert into products (productname) values ('testprod 1')";
00042 $sql3 = "insert into products (productname) values ('testprod 2')";
00043 $sql4 = "delete from products where productid>80";
00044 $sql5 = 'select * from products';
00045
00046 if ($testhttp) {
00047 print "<a href=#c>Client Driver Tests</a><p>";
00048 print "<h3>Test Error</h3>";
00049 $rs = send2server($serverURL,$sql1);
00050 print_pre($rs);
00051 print "<hr />";
00052
00053 print "<h3>Test Insert</h3>";
00054
00055 $rs = send2server($serverURL,$sql2);
00056 print_pre($rs);
00057 print "<hr />";
00058
00059 print "<h3>Test Insert2</h3>";
00060
00061 $rs = send2server($serverURL,$sql3);
00062 print_pre($rs);
00063 print "<hr />";
00064
00065 print "<h3>Test Delete</h3>";
00066
00067 $rs = send2server($serverURL,$sql4);
00068 print_pre($rs);
00069 print "<hr />";
00070
00071
00072 print "<h3>Test Select</h3>";
00073 $rs = send2server($serverURL,$sql5);
00074 if ($rs) rs2html($rs);
00075
00076 print "<hr />";
00077 }
00078
00079
00080 print "<a name=c><h1>CLIENT Driver Tests</h1>";
00081 $conn = ADONewConnection('csv');
00082 $conn->Connect($serverURL);
00083 $conn->debug = true;
00084
00085 print "<h3>Bad SQL</h3>";
00086
00087 $rs = $conn->Execute($sql1);
00088
00089 print "<h3>Insert SQL 1</h3>";
00090 $rs = $conn->Execute($sql2);
00091
00092 print "<h3>Insert SQL 2</h3>";
00093 $rs = $conn->Execute($sql3);
00094
00095 print "<h3>Select SQL</h3>";
00096 $rs = $conn->Execute($sql5);
00097 if ($rs) rs2html($rs);
00098
00099 print "<h3>Delete SQL</h3>";
00100 $rs = $conn->Execute($sql4);
00101
00102 print "<h3>Select SQL</h3>";
00103 $rs = $conn->Execute($sql5);
00104 if ($rs) rs2html($rs);
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198 ?>