This is the class and within it I have the function ConsultarPrestamos
:
class bibliotecaCliente{
public $PUBLICMYSQL;
function bibliotecaCliente(){
$this->PUBLICMYSQL = new CONMYSQL;
$this->PUBLICMYSQL->conectar();
}
This is the class and within it I have the function ConsultarPrestamos
:
class bibliotecaCliente{
public $PUBLICMYSQL;
function bibliotecaCliente(){
$this->PUBLICMYSQL = new CONMYSQL;
$this->PUBLICMYSQL->conectar();
}
First of all, you are wrongly initializing your class:
$prestamos = new bibliotecaCliente();
// Te faltó añadir los dos parentesis
Then, the variable $bibliotecaCliente
is not inizialized anywhere, so you must access the consultarprestamos();
method by $prestamos
which is the instance created previously
$prestamos->consultarprestamos();
Try this way to call the method:
$prestamos->consultarprestamos();