diff --git a/tests/odbc-display.php b/tests/odbc-display.php new file mode 100644 index 00000000000..f79a854aea8 --- /dev/null +++ b/tests/odbc-display.php @@ -0,0 +1,19 @@ + diff --git a/tests/odbc-t1.php b/tests/odbc-t1.php new file mode 100644 index 00000000000..90cb97910f5 --- /dev/null +++ b/tests/odbc-t1.php @@ -0,0 +1,38 @@ + + +Quick & dirty ODBC test + + +

ODBC Test 1 - Connection

+"; + $conn = odbc_connect($dsn,$dbuser,$dbpwd); + if(!$conn){ +?> +

Error connecting to database! Check DSN, username and password

+ +

Connection successful

+">Proceed to next test +| Change login information + +You will need permisson to create tables for the following tests! +
+ + + + +
Database (DSN):
User:
Password:
+
+ + +
+ + + diff --git a/tests/odbc-t2.php b/tests/odbc-t2.php new file mode 100644 index 00000000000..a500b09e8b5 --- /dev/null +++ b/tests/odbc-t2.php @@ -0,0 +1,82 @@ + + +Quick & dirty ODBC test #2 + + +

ODBC Test 2 - Create table

+ +

Error connecting to database! Check DSN, username and password

+ +- OK

+Dropping table "php3_test" + +- OK

+Create table "php_test" + + - OK

+Table Info:
+ + + + + + + + + + + + + +
NameTypeLength
+

+


+

+">Proceed to next test +| Change login information + + + +

+ + + + +
Database (DSN):
User:
Password:
+ +
+ + + + diff --git a/tests/odbc-t3.php b/tests/odbc-t3.php new file mode 100644 index 00000000000..edfdc658f89 --- /dev/null +++ b/tests/odbc-t3.php @@ -0,0 +1,95 @@ + + +Database test #3 + + +

ODBC Test 3 - Insert records

+ +

Error connecting to database! Check DSN, username and password

+ + - OK

+Clearing table "php_test" + + - OK

+Inserting into table "php_test" + + - OK

+

The table "php_test" should now contain the following values:

+ + + + + + + + + + + + + + + + + + + +
ABCD
test-11001100.01php - values 1
test-21002200.02php - values 2
test-31003300.03php - values 3
test-41004400.04php - values 4
test-51005500.05php - values 5
+ +

Actual contents of table "php_test":

+ +

+


+

+">Proceed to next test +| Change login information + +

+ + + + +
Database:
User:
Password:
+ + +
+ + + + diff --git a/tests/odbc-t4.php b/tests/odbc-t4.php new file mode 100644 index 00000000000..10e8f4b2d96 --- /dev/null +++ b/tests/odbc-t4.php @@ -0,0 +1,91 @@ + + +Database test #4 + + +

ODBC Test 4 - Cursors

+The following test requires your ODBC driver to support positioned updates

+ +

Error connecting to database! Check DSN, username and password

+ + - OK

+Updating table "php_test" +1002 for update'))){ + $cursor = odbc_cursor($result); + if(($upd = odbc_prepare($conn,"update php_test set a=?, b=? where current of $cursor"))){ + while(odbc_fetch_row($result)) { + $params[0] = odbc_result($result, 1) . "(*)"; + $params[1] = odbc_result($result, 2) + 2000; + odbc_execute($upd, $params); + } + odbc_commit($conn); + } + } + if($result && $upd){ +?> + - OK

+

The table "php_test" should now contain the following values:

+ + + + + + + + + + + + + + + + + + + + + + +
ABCD
test-11001100.01php3 - values 1
test-21002200.02php - values 2
test-3(*)3003300.03php - values 3
test-4(*)3004400.04php - values 4
test-5(*)3005500.05php - values 5
+ Note: If you reload this testpage,
+ the three last rows will contain different
values in columns A and B
+
+ +

Actual contents of table "php_test":

+"; + } +?> +


+">Proceed to next test + +

+ + + + +
Database:
User:
Password:
+ + +
+ + + diff --git a/tests/odbc-t5.php b/tests/odbc-t5.php new file mode 100644 index 00000000000..13af52d2226 --- /dev/null +++ b/tests/odbc-t5.php @@ -0,0 +1,137 @@ + + +Database test #5 + + +

ODBC Test 5 - Blobs

+ +

Please select the images (gif) you want to put into the database

+
+Image 1:

+Image 2:

+Image 3:

+Blob database type name: +

+ + + + +| +

+ + + +

Error connecting to database! Check DSN, username and password

+ + - OK

+Images in database"; + while(odbc_fetch_into($res, &$imgs)){ + echo "$imgs[0] : \n

"; + } + }else{ + echo "Couldn't execute query"; + } + echo "\n\n"; + exit; + } +?> +Dropping table "php_test" + + - OK

+Creating table "php_test": + + - OK

+Table Info:
+ + + + + + + + + + + + + +
NameTypeLength
+ +Inserting data: + + - OK

+">Display Images + +

+ + + + +
Database:
User:
Password:
+ + +
+ + +