Good morning, I'm making a page and I'm making the connection to the database but it sends me the following error
<?php
require 'init.php';
class Funciones{
public function getPublicaciones(){
global $pdo;
$query = $pdo->prepare("
SELECT *
FROM blog
");
$query->execute();
return $query->fetchALL();
}
}
?>
And I'm calling it like this:
<?php
require 'php/Funciones.php';
$obj = new Funciones();
$publicaciones = $obj->getPublicaciones();
echo '<pre>', print_r($publicaciones), '</pre>';
exit();
?>