la tengo declarada en basedatos.php
este es el codigo:
Código PHP:
<?php
class basedatos
{
protected $host;
protected $user;
protected $pass;
protected $slbd;
protected $conx;
public function __construct($h="localhost", $u="root", $p="admin", $s="appweb1")
{
$this->host = $h;
$this->user = $u;
$this->pass = $p;
$this->slbd = $s;
$this->conx = mysql_connect($this->host, $this->user, $this->pass= "huevos");
if (!$this->conx)
{
die("Error: ".mysql_error());
}
else
{
mysql_select_db($this->slbd, $this->conx);
}
}
public function cerrarbd()
{
mysql_close($this->conx);
}
}
?>