setting lock bucket mutex name
[csql.git] / test / phptests / index1.php
blob165424245845aef520890621e69ebcb677f290a9
1 <html>
2 <body>
3 /* Creating table with 3 INT fields, Create index on single field.
4 Create all possible composite indexes.
5 check basic INSERT, SELECT */
6 <?php
7 $conn=odbc_connect('mycsql','root','manager');
8 if (!$conn)
10 echo "Connection Failed";
11 exit(1);
14 $sth = odbc_prepare($conn,"create table t1 (f1 int ,f2 int,f3 int );");
15 $res = odbc_execute($sth);
16 if (!$res)
18 echo "Error in Table Creation";
19 exit(2);
21 echo "Table Created";
23 $sth = odbc_prepare($conn, "create index idx1 on t1(f1);");
24 $res = odbc_execute($sth);
25 if (!$res)
27 echo "Error in Index creation";
28 exit(3);
30 echo "\ncreate index idx1 on t1(f1);";
31 echo "\nIndex created\n";
33 $sth = odbc_prepare($conn, "create index idx2 on t1(f1,f2);");
34 $res = odbc_execute($sth);
35 if (!$res)
37 echo "Error in Index creation";
38 exit(4);
40 echo "\ncreate index idx2 on t1(f1,f2);";
41 echo "\nComposite key Index created\n";
43 $sth = odbc_prepare($conn, "create index idx5 on t1(f1,f2,f3);");
44 $res = odbc_execute($sth);
45 if (!$res)
47 echo "Error in Index creation";
48 exit(5);
50 echo "\ncreate index idx5 on t1(f1,f2,f3);";
51 echo "\nComposite key Index created\n";
53 $res = odbc_exec($conn, "DROP TABLE t1;");
54 if (!$res)
57 echo "\nError in Drop Table";
58 exit(6);
60 echo "\nTable Dropped\nTest Passed";
61 odbc_close($conn);
64 </body>
65 </html>