Query:
static public function contarAccesorios(){
$ejecucion = self::Conexion();
$sql = "SELECT count(idaccesorio) FROM accesorios;";
$registro = $ejecucion->query($sql);
return $registro;
}
Why do you give me the following error?
Recoverable fatal error: Object of class PDOStatement could not be converted to string
Test:
echo BD::contarAccesorios();