Well guys, I'm starting to study about PDO, but soon in my first activity there is an error, all the information is below.
CODE Object.php
<?php
$cli = new Produtos();
$cli->insert();
CODE Product.php
<?php
class Produtos extends Conexao{
public function insert(){
$this->conectar();
}
}
CODE Connection.php
class Conexao{
private static $conexao;
public function conectar(){
try{
if (!isset(self::$conexao)) {
self::$Conexao = new pdo("mysql:host=localhost; dbname = renanmeh_bd_projeto","root","")
}
}catch(PDOException $e){
echo "Erro ao conectar ao banco ".$e->getMessage;
}
return self::$conexao
}
}
Basically this is just a test, where I have object that instantiates the product class, and this product class makes a request in the connection class.