3 /*Parateterised delete*/
5 $conn=odbc_connect('mycsql','root','manager');
8 echo "Connection Failed";
12 $res = odbc_exec($conn,"CREATE TABLE t1(f1 INT, f2 CHAR(20),f3 int);");
15 echo "Error in Creation";
18 echo "Table Created\n";
20 $res = odbc_exec($conn,"INSERT INTO t1 values(10,'ABCD',1);");
23 echo "Error in Creation";
26 echo "Table Created\n";
28 $res = odbc_exec($conn,"INSERT INTO t1 values(20,'PQRS',2);");
31 echo "Error in Creation";
34 echo "Table Created\n";
36 $sth = 'SELECT * FROM t1;';
37 $rs = odbc_exec($conn, $sth);
40 echo "Error in SQL-2";
43 odbc_result_all($rs, 'border = 5');
45 $q = "DELETE FROM t1 WHERE f1=?;";
46 $res = odbc_prepare ($conn, $q);
48 $exc = odbc_execute($res, array($a));
54 $sth = 'SELECT * FROM t1;';
55 $rs = odbc_exec($conn, $sth);
57 {exit("Error in SQL-2");}
58 odbc_result_all($rs, 'border = 5');
60 $sth=odbc_prepare($conn,"DROP TABLE t1;");
61 $res = odbc_execute($sth);
63 {exit("\nError in Drop Table");}
64 echo "\nTable Dropped \nTest Passed";