Código PHP:
Ver original
<?php class Security{ private $db_host; private $db_name; private $db_user; private $db_password; private $connection; public $ADMIN = false; public $PRODUCTOS_AGREGAR = false; public $PRODUCTOS_MODIFICAR = false; public $CLIENTES_AGREGAR = false; public $CLIENTES_MODIFICAR = false; public $CONTENIDOS_ADMIN = false; function Security() { include_once("includes/inc.config.php"); $this->db_host = $dbhost; $this->db_name = $dbname; $this->db_user = $dbuser; $this->db_password = $dbpassword; } public function load_from_user($userID) { $result = false; $this->connect(); $query = "SELECT a.perfil_id, b.perfil FROM tabla a INNER JOIN ids_perfiles b ON (a.perfil_id = b.id) WHERE user_id = '".$userID."' "; echo $query; if(!$userID == 0) { { $this->{$row->perfil} = true; } } return $result; $this->disconnect(); } function connect() { $this->connection = mysql_connect($this->db_host, $this->db_user, $this->db_password) or die("Unable to connect to MySQL"); if($this->connection) { return true; } else return false; } function disconnect() { } } ?>
El include tiene solamente las variables con los datos de la DB.
El mensaje que sale en pantalla es Unable to select DB!
Ok, muchas gracias!
Gustav.