Last active
January 9, 2016 05:40
-
-
Save maclochlainn/6415857 to your computer and use it in GitHub Desktop.
PHP Test Connection to an Oracle 12c Pluggable Database (PDB). The user is video, the TNS alias is video, and the service name is videodb. The service name is listed in the tnsnames.ora file as the SID_NAME.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Attempt to connect to your database. | |
$c = @oci_connect("video", "video", "localhost/videodb"); | |
if (!$c) { | |
print "Sorry! The connection to the database failed. Please try again later."; | |
die(); | |
} | |
else { | |
print "Congrats! You've connected to an Oracle database!"; | |
oci_close($c); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment