Page 1 of 1
PHP connection with Oracle 10g?
Posted: Tue Mar 16, 2010 8:04 am
by adilmarwat2004
Dear!
I have installed Oracle 10g and PHP.
I want to made the connection of PHP with oracle 10g. How it is possible and is it possible through Dreamweaver. if it please provide the way for connecting?
thanks
Adil
Re: PHP connection with Oracle 10g?
Posted: Tue Mar 16, 2010 8:11 am
by papa
Sure it is.
I did an application for Oracle 10 a couple of months back. Search google for tutorials.
I put my DNS in a config.ini and made a simple db class.
Not very pretty though:
Code: Select all
function __construct($username, $password, $db_name='', $host='', $tns='')
{
//Db Vars
$this->username = $username;
$this->password = $password;
$this->db_name = $db_name;
$this->host = $host;
$this->tns = $tns;
//Connect to db
if(!($this->conn = self::db_connect())) die("<b>Error:</b> No Connection to Database");
}
function db_connect()
{
if($oci = @oci_connect($this->username, $this->password, $this->tns)) return $oci;
else return false;
}