diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-30 15:43:52 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-30 15:43:52 +0100 |
commit | 8ea6ea6db019f68436a69f36aae55a9f205efa35 (patch) | |
tree | 5c367520523c42b1935491d199b4e8f3c17b4708 /doc/nils-diplom/Dateistruktur/lessons/errror_tests.php | |
parent | ec6e82dbcdc153b9973240cdff91a03b6d2dc886 (diff) | |
download | sqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.tar.gz sqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.tar.bz2 sqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.zip |
doc: Nils Weber doesnt have an 'e' in his firstname
Diffstat (limited to 'doc/nils-diplom/Dateistruktur/lessons/errror_tests.php')
-rwxr-xr-x | doc/nils-diplom/Dateistruktur/lessons/errror_tests.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/doc/nils-diplom/Dateistruktur/lessons/errror_tests.php b/doc/nils-diplom/Dateistruktur/lessons/errror_tests.php new file mode 100755 index 0000000..cb59e58 --- /dev/null +++ b/doc/nils-diplom/Dateistruktur/lessons/errror_tests.php @@ -0,0 +1,52 @@ +<? + + +$sql = "test"; + +fehler($sql); + +// Display OCI error +function PrintOCIError($err) +{ + echo "<pre>".$err['message']."</pre>\n"; + die(); +} + + +function fehler($stmt) +{ + + $username = "nils"; + $password = "nils"; + $database = "ora9"; + + $con = @OCILogon($username, $password, $database); + if (!$con) { + $e = OCIError(); // For OCILogon errors pass no parameter + PrintOCIError($e); + } + + echo "Connected OK\n"; + + $stid = @OCIParse($con, $stmt); + if (!$stid) + { + $e = OCIError($con); // For OCIParse errors pass the connection + PrintOCIError($e); + } + + echo "Parsed OK\n"; + + $r = @OCIExecute($stid); + if (!$r) + { + $e = OCIError($stid); // For OCIExecute errors pass the statement + PrintOCIError($e); + } + + echo "Executed OK\n"; +} + + + +?> |