3 /* odbc_result_all() test for display the conditional select result in formated manner. It is more advance than odbc_result() */
5 $conn=odbc_connect('mycsql','root','manager');
8 echo "Connection Failed";
12 $sth = odbc_prepare($conn,"CREATE TABLE t1(f1 INT, f2 CHAR(20),f3 SMALLINT,primary key(f1,f3));");
13 $res = odbc_execute($sth);
18 echo "Table Created\n";
20 $sth = odbc_prepare($conn,"INSERT INTO t1 VALUES(200,'NP',2);");
21 $res = odbc_execute($sth);
26 echo "Record Inserted\n";
28 $sth = odbc_prepare($conn,"INSERT INTO t1 VALUES(100,'PP',1);");
29 $res = odbc_execute($sth);
34 echo "Record Inserted\n";
36 $sth = odbc_prepare($conn,"INSERT INTO t1 VALUES(300,'RP',3);");
37 $res = odbc_execute($sth);
42 echo "Record Inserted\n";
44 $sth = 'SELECT * FROM t1 where f1<=200;';
45 $rs = odbc_exec($conn, $sth);
50 odbc_result_all($rs, 'border = 5');
52 $sth=odbc_prepare($conn,"DROP TABLE t1;");
53 $res = odbc_execute($sth);
56 echo "\nError in Drop Table";
59 echo "\nTable Dropped \nTest Passed";