r4gn0
04-23-2008, 05:10 PM
Hi!! how can i connect to a remote oracle bd that its in my network? i can connect with Toad, by cmd with sqlplus, but i cant connect with php :(
how can i do it??
im using a connection class that works when i upload files in localhost, but when i test files in my pc it doesnt.
<?php
class Db
{
var $db_USER = "";
var $db_PASS = "";
var $base = "";
var $dbc = 0;
var $cur;
function Db($user, $pass)
{
$this->db_USER = $user;
$this->db_PASS = $pass;
$this->dbc = ora_logon($this->db_USER,$this->db_PASS);
$cur=ora_open($this->dbc);
}
function consulta($sql="")
{
$cur=ora_open($this->dbc);
$parse = ora_parse($cur,$sql);
$result = ora_exec($cur);
return($result);
}
function close_db()
{
ora_close($this->dbc);
}
}
?>
It works for the connection, if you see there is something wrong in the file, please let me know...this is the instruction to connect from the php that includes the file.
require_once('conexion.php');
$miconexion = new Db("siges@prueba","siges") ;
$qid = $miconexion->consulta(select * from table);
how can i do it??
im using a connection class that works when i upload files in localhost, but when i test files in my pc it doesnt.
<?php
class Db
{
var $db_USER = "";
var $db_PASS = "";
var $base = "";
var $dbc = 0;
var $cur;
function Db($user, $pass)
{
$this->db_USER = $user;
$this->db_PASS = $pass;
$this->dbc = ora_logon($this->db_USER,$this->db_PASS);
$cur=ora_open($this->dbc);
}
function consulta($sql="")
{
$cur=ora_open($this->dbc);
$parse = ora_parse($cur,$sql);
$result = ora_exec($cur);
return($result);
}
function close_db()
{
ora_close($this->dbc);
}
}
?>
It works for the connection, if you see there is something wrong in the file, please let me know...this is the instruction to connect from the php that includes the file.
require_once('conexion.php');
$miconexion = new Db("siges@prueba","siges") ;
$qid = $miconexion->consulta(select * from table);