I'm trying to make a connection to the database via PDO, but every time I try to make that connection, the following message appears:
could not find driver
I went back to know and I knew that I had to enable the PDO in php.ini. Okay, I went there and took the; from where I needed it, but still the message still appears.
My code is this:
<?php
try{
// Faz conexão com banco de daddos
$pdo = new PDO("
mysql:host=localhost;
dbname=servidores;",
"root",
"root");
}catch(PDOException $e){
// Caso ocorra algum erro na conexão com o banco, exibe a mensagem
echo 'Falha ao conectar no banco de dados: '.$e->getMessage();
die;
}
?>
Does anyone know what it can be?