1
resposta

Quando clico em categorias da erro!!!

Quando clico em categorias aparece esse fatal error:

Fatal error: Uncaught PDOException: PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers in C:\Gdy-projetos\learning-php\PHP-BD\aula1\classes\Categoria.php:12 Stack trace: #0 C:\Gdy-projetos\learning-php\PHP-BD\aula1\classes\Categoria.php(12): PDO->__construct('mysql:host=127....', 'root', 'alura') #1 C:\Gdy-projetos\learning-php\PHP-BD\aula1\categorias.php(4): Categoria->listar() #2 {main} Next PDOException: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers in C:\Gdy-projetos\learning-php\PHP-BD\aula1\classes\Categoria.php:12 Stack trace: #0 C:\Gdy-projetos\learning-php\PHP-BD\aula1\classes\Categoria.php(12): PDO->__construct('mysql:host=127....', 'root', 'alura') #1 C:\Gdy-projetos\learning-php\PHP-BD\aula1\categorias.php(4): Categoria->listar() #2 {main} thrown in C:\Gdy-projetos\learning-php\PHP-BD\aula1\classes\Categoria.php on line 12
1 resposta

Eduardo, boa tarde!

Você poderia verificar como está sendo feita a implementação da construção do PDO? acredito que possa estar errado:

Tente verificar se está igual a do instrutor!

 $conexao = new PDO('mysql:host=127.0.0.1;dbname=estoque', 'root', 'alura');

Espero ter ajudado e bons estudos!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software