bluetoother Posted September 5, 2007 Share Posted September 5, 2007 can i connect my php scripts to oracle DB on remote server when iam using a hosting serveras same as connecting your web site to mysql databse,i mean : when i connect the web site to mysql DB i need to know the ip address of the DB server and DB name,, is it the same for oracle and php ? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 5, 2007 Share Posted September 5, 2007 Check the reference page:http://www.php.net/manual/en/function.oci-connect.php Link to comment Share on other sites More sharing options...
bluetoother Posted September 6, 2007 Author Share Posted September 6, 2007 ok that page shows how to connect to local DB on the same server,what if the DB server is on another computer and i only know that computer IP address and the DB namegot any examples ? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 6, 2007 Share Posted September 6, 2007 Check the user notes on that page and the notes for ocilogon, they show how to do it. Link to comment Share on other sites More sharing options...
skaterdav85 Posted December 23, 2009 Share Posted December 23, 2009 Looking at that link, is this all you really need to connect to a remote db server? <?php$username = "some username";$password = "some pw";$db = "(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = something.something.com)(PORT = 9999))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = something.something.com)))";$conn = oci_connect($username, $password, $db);if (!$conn) { echo 'you fail';} else { echo "success!";}?> I get a fatal error saying: Fatal error: Call to undefined function oci_connect() in C:\xampp\htdocs\OOP_PHP\Oracle_call.php on line 7 Also, what is contained in my $db variable? Someone gave me this information but I dont know what it means, since Im not very familiar with Oracle. Link to comment Share on other sites More sharing options...
justsomeguy Posted December 24, 2009 Share Posted December 24, 2009 That error means the Oracle extension is not installed for PHP. In that case $db is just a string, it's the connection string for the database. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.