- Aun nada Patriarka, y la verdad no entiendo en que momento se le esta asignando un valor a $cod_empresa ??
Código PHP:
Ver original<?php
class Conexion
{
public $ndatabase ="";
public function conectar($cod_empresa="")
{
$this->$ndatabase = $cod_empresa;
$server = 'sbvbieloven';
$database = $this->$ndatabase;
$username = 'profit';
$password = 'profit';
return $conexion = new PDO('sqlsrv:Server=' . $server . ';Database='. $database, $username, $password);
$this->dbh->exec("SET CHARACTER SET utf8"); }
}
?>
Notice: Undefined variable: ndatabase in C:\xampp\htdocs\sismica\conexion.table.php on line 7
Fatal error: Cannot access empty property in C:\xampp\htdocs\sismica\conexion.table.php on line 7