test cases for trie index
[csql.git] / test / phptests / paraselect.php
blob19223463facd9b1ed6de79a48cf33bf798412307
1 <html>
2 <body>
3 /*Parateterised delete*/
4 <?php
5 $conn=odbc_connect('mycsql','root','manager');
6 if (!$conn)
8 echo "Connection Failed";
9 exit(1);
12 $res = odbc_exec($conn,"CREATE TABLE t1(f1 INT, f2 CHAR(20),f3 int);");
13 if (!$res)
15 exit(2);
17 echo "Table Created\n";
19 $res = odbc_exec($conn,"INSERT INTO t1 values(10,'ABCD',1);");
20 if (!$res)
22 exit(3);
24 echo "Table Created\n";
26 $res = odbc_exec($conn,"INSERT INTO t1 values(20,'PQRS',2);");
27 if (!$res)
29 exit(4);
31 echo "Table Created\n";
33 $sth = 'SELECT * FROM t1;';
34 $rs = odbc_exec($conn, $sth);
35 if (!$rs)
37 exit(5);
39 odbc_result_all($rs, 'border = 5');
41 $q = "SELECT * FROM t1 WHERE f1=?;";
42 $res = odbc_prepare ($conn, $q);
43 $a = 10;
44 $res1 = odbc_execute($res, array($a));
45 if (!$res)
47 exit(6);
50 echo "<table><tr>";
51 echo "<th>ROLL</th>";
52 echo "<th>NAME</th></tr>";
53 while (odbc_fetch_row($res))
55 $roll=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($res, 1));
56 $name=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($res, 2));
57 echo "<tr><td>$roll</td>";
58 echo "<td>$name</td></tr>\n";
60 echo "</table>";
63 $sth=odbc_prepare($conn,"DROP TABLE t1;");
64 $res = odbc_execute($sth);
65 if (!$res)
66 {exit("\nError in Drop Table");}
67 echo "\nTable Dropped \nTest Passed";
68 odbc_close($conn);
71 </body>
72 </html>