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);");
17 echo "Table Created\n";
19 $res = odbc_exec($conn,"INSERT INTO t1 values(10,'ABCD',1);");
24 echo "Table Created\n";
26 $res = odbc_exec($conn,"INSERT INTO t1 values(20,'PQRS',2);");
31 echo "Table Created\n";
33 $sth = 'SELECT * FROM t1;';
34 $rs = odbc_exec($conn, $sth);
39 odbc_result_all($rs, 'border = 5');
41 $q = "SELECT * FROM t1 WHERE f1=?;";
42 $res = odbc_prepare ($conn, $q);
44 $res1 = odbc_execute($res, array($a));
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";
63 $sth=odbc_prepare($conn,"DROP TABLE t1;");
64 $res = odbc_execute($sth);
66 {exit("\nError in Drop Table");}
67 echo "\nTable Dropped \nTest Passed";