How to Connect to Remote Oracle Database through PHP?

Can you see what's wrong with this php code stuff? Trying to connect to database.?

  • <?php $username='user'; $password='password'; // For security this bit is normally achieved with an include file $host='co-project.lboro.ac.uk'; $dbName='database'; $dsn = "mysql://$user:$password@$co-project.lbo… //Data Source Name $db =& MDB2::connect($dsn); //Try to make a connection if (PEAR::isError($db)) { die($db-getMessage()); } mysql_select_db("database", $con); $result = mysql_query("SELECT * FROM iBayItems"); while($row = mysql_fetch_array($result)) { echo $row['title'] . " " . $row['userId']; echo " "; } //mysql_close($con); ?> I don't really have much idea what I'm doing, but I think this is roughly what it's supposed to look like, however when I try to make it work all I get is "; } //mysql_close($con); ?> I think this means there's something wrong in the last tiny bit. (I've //'d out the last line because it didn't seem like the computer was reading past that anyway.) I'm trying to get it to connect to the database and output some stuff to show that it's done it.

  • Answer:

Lemon Pirate at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

May be this extra space between "& and MDB2 " If you don't find this to be cleared i can't say whats wrong without looking into the class "MDB2" $db =& MDB2::connect($dsn); //Try to make a connection

CheapestSiteHosting

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.