test cases for trie index
[csql.git] / test / phptests / odbc_result_all.php
blobfeeb36174c835181a44a042e0ab342a33aeb65c4
1 <html>
2 <body>
3 /* odbc_result_all() test for display the conditional select result in formated manner. It is more advance than odbc_result() */
4 <?php
5 $conn=odbc_connect('mycsql','root','manager');
6 if (!$conn)
8 echo "Connection Failed";
9 exit(1);
12 $sth = odbc_prepare($conn,"CREATE TABLE t1(f1 INT, f2 CHAR(20),f3 SMALLINT,primary key(f1,f3));");
13 $res = odbc_execute($sth);
14 if (!$res)
16 exit(2);
18 echo "Table Created\n";
20 $sth = odbc_prepare($conn,"INSERT INTO t1 VALUES(200,'NP',2);");
21 $res = odbc_execute($sth);
22 if (!$res)
24 exit(3);
26 echo "Record Inserted\n";
28 $sth = odbc_prepare($conn,"INSERT INTO t1 VALUES(100,'PP',1);");
29 $res = odbc_execute($sth);
30 if (!$res)
32 exit(4);
34 echo "Record Inserted\n";
36 $sth = odbc_prepare($conn,"INSERT INTO t1 VALUES(300,'RP',3);");
37 $res = odbc_execute($sth);
38 if (!$res)
40 exit(5);
42 echo "Record Inserted\n";
44 $sth = 'SELECT * FROM t1 where f1<=200;';
45 $rs = odbc_exec($conn, $sth);
46 if (!$rs)
48 exit(6);
50 odbc_result_all($rs, 'border = 5');
52 $sth=odbc_prepare($conn,"DROP TABLE t1;");
53 $res = odbc_execute($sth);
54 if (!$res)
56 echo "\nError in Drop Table";
57 exit(7);
59 echo "\nTable Dropped \nTest Passed";
60 odbc_close($conn);
63 </body>
64 </html>