windows changes
[csql.git] / test / phptests / odbcfree.php
blob9b4f722e358dbdba8421e02c7d05d67b155077fc
1 <html>
2 <body>
3 /*Testing Querry Memory Free with odbc_free_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,f4 BIGINT,f5 FLOAT, f6 DOUBLE,f7 DATE, f8 TIMESTAMP );");
13 $res = odbc_execute($sth);
14 if (!$res)
16 echo "Error in Creation";
17 exit(2);
19 echo "Table Created\n";
21 $sql = 'SELECT f3,f5,f7 FROM t1';
22 $result = odbc_exec($conn, $sql);
23 echo "\nFreeing query Memory\n";
25 $freeing = odbc_free_result($result);
26 if (!$res)
28 exit(3);
30 echo "Query memory freed\n";
32 $sth=odbc_prepare($conn,"DROP TABLE t1;");
33 $res = odbc_execute($sth);
34 if (!$res)
36 echo "\nError in Drop Table";
37 exit(4);
39 echo "\nTable Dropped \nTest Passed";
40 odbc_close($conn);
43 </body>
44 </html>