setting lock bucket mutex name
[csql.git] / test / phptests / autoincrement.php
blob116ba3e09e3c83382cff6891aa57a2b96688c206
1 <html>
2 <body>
3 /*Autoincrement testing */
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 auto_increment, f2 CHAR(20));");
13 $res = odbc_execute($sth);
14 if (!$res)
16 exit(2);
18 echo "Table Created";
20 $sth = odbc_prepare($conn, "INSERT INTO t1(f2) VALUES('One');");
21 $res = odbc_execute($sth);
22 if (!$res)
24 exit(3);
26 echo "\nINSERT INTO t1(f2) VALUES('One');";
27 echo "\nRecord Inserted";
29 $sth = odbc_prepare($conn, "INSERT INTO t1(f1,f2) VALUES(5,'Five');");
30 $res = odbc_execute($sth);
31 if (!$res)
33 exit(4);
35 echo "\nINSERT INTO t1(f1,f2) VALUES(5,'Five');";
36 echo "\nRecord Inserted";
38 $sth = odbc_prepare($conn, "INSERT INTO t1(f2) VALUES('Six');");
39 $res = odbc_execute($sth);
40 if (!$res)
42 exit(5);
44 echo "\nINSERT INTO t1(f2) VALUES('Six');";
45 echo "\nRecord Inserted";
47 $sth = odbc_prepare($conn, "INSERT INTO t1(f1,f2) VALUES(3,'Three');");
48 $res = odbc_execute($sth);
49 if (!$res)
51 exit(6);
53 echo "\nINSERT INTO t1(f1,f2) VALUES(3,'Three');";
54 echo "\nRecord Inserted";
56 $sth = odbc_prepare($conn, "INSERT INTO t1(f2) VALUES('Seven');");
57 $res = odbc_execute($sth);
58 if (!$res)
60 exit(7);
62 echo "\nINSERT INTO t1(f2) VALUES('Eight');";
63 echo "\nRecord Inserted\n";
65 $sth = 'select * from t1;';
66 $rs = odbc_exec($conn, $sth);
67 if (!$rs)
69 exit(8);
71 echo "\nselect executed\n";
72 odbc_result_all($rs);
73 $sth=odbc_prepare($conn,"DROP TABLE t1;");
74 $res = odbc_execute($sth);
75 if (!$res)
77 exit(9);
79 echo "\nTable Dropped \nTest Passed";
80 odbc_close($conn);
83 </body>
84 </html>