windows porting changes
[csql.git] / test / phptests / odbc_fetch_array.php
blob673c6568fe4d3baf4c38c34633427e960fa678ba
1 <html>
2 <body>
3 /*Testing odbc_fetch_array()*/
4 <?php
5 $conn=odbc_connect('mycsql','root','manager');
6 if (!$conn)
7 {echo "Connection Failed";exit(1);}
9 odbc_exec($conn,"CREATE TABLE t1(f1 INT, f2 CHAR(20),f3 SMALLINT,f4 BIGINT,f5 FLOAT, f6 DOUBLE,f7 DATE, f8 TIMESTAMP );");
10 odbc_exec($conn,"INSERT INTO t1(f1,f3,f4) values(10,'ABCD',100001);");
11 odbc_exec($conn,"INSERT INTO t1(f1,f2,f3) values(20,'BCAD',1);");
13 $sql = 'SELECT * from t1;';
14 $result = odbc_exec($conn, $sql);
16 while ($row = odbc_fetch_array($result))
18 echo $row["f1"], "\n";
20 //fetch array is not working:remove below 2 lines after it is fixed
21 odbc_exec($conn,"DROP TABLE t1;");
22 exit(1);
23 $sth=odbc_prepare($conn,"DROP TABLE t1;");
24 $res = odbc_execute($sth);
25 if (!$res)
26 {echo "\nError in Drop Table"; exit(2);}
27 echo "\nTable Dropped \nTest Passed";
28 odbc_close($conn);
31 </body>
32 </html>