Subject Re: [firebird-support] Firebird and web connection
Author esdonisgarcia
In php you can do something like this:

<?php
class cfbcn {
private $db, $cn, $rs;

public function __construct($server, $port, $db, $username, $password,
$cset, $buf, $dial, $role){
if ($this->port){
$this->db = $server ."/". $port .":". $db;
} else {
$this->db = $server .":". $db;
}
$this->cn = ibase_connect($this->db, $username, $password, $cset,
$buf, $dial, $role);
}

function __destruct(){ibase_close($this->cn);}

public function listar($sql,$param){
if ($this->cn){
$reg = array();
$this->rs = ibase_query($this->cn,$sql,$param);
if ($this->rs){
while ($row = ibase_fetch_row($this->rs)) $reg[] = $row;
ibase_free_result($this->rs);
return (!$reg)?array('tipo'=>false,'texto'=>'La consulta no
devolvió datos.'):array('tipo'=>true,'texto'=>$reg);
} else {
return array('tipo'=>false,'texto'=>'Error de ejecusión: '
.ibase_errmsg());
}
} else {
return array('tipo'=>false,'texto'=>'Error de conexión: '
.ibase_errmsg());
}
}

public function actualizar($sql,$param){
if ($this->cn){
$tr = ibase_trans(IBASE_WRITE,$this->cn);
$qr = ibase_prepare($this->cn,$tr,$sql);
$this->rs = ibase_execute($qr,$param);
if ($this->rs){
ibase_commit($tr);
} else {
ibase_rollback($tr);
return array('tipo'=>false,'texto'=>'Error de ejecusión: '
.ibase_errmsg());
}
ibase_free_query($qr);
return array('tipo'=>true,'texto'=>'');
} else {
return array('tipo'=>false,'texto'=>'Error de conexión: '
.ibase_errmsg());
}
}
}
?>


> Hello I'm looking for any information on connecting to a firebird database
> by IP adresse.
> The database is placed on a web server with a permanent IP...
> is it possible ?, and where to find information on how to do it...
>
>
> Big thank you in advance for any help !
> Mikey.
>

Best Regards
======
ISMAEL
======
Only for the small landowners and Cubans companies
Website: www.sisconge.byethost15.com
www.sisconge.hol.es