I'm at a loss on what I'm doing wrong with my PDO connection to PHPmyadmin mysql. I know this question has been asked numerous times on other SO articles and I looked up this one and I'm still having issues. I don't know what I'm doing wrong.
Here is the SO article similar to my problem I'm trying to solve.
Other SO problem similiar to mine
Here is my configuration settings:
MySQL version: 10.1.38-MariaDB - mariadb.org binary distribution
PHP version: 5.6.40
Server charset: UTF-8 Unicode (utf8)
DB Connection File:
<?php
session_start();
//error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);
$dbhost_name = "localhost";
$database = "testdb";
$username = "root";
$charset='utf8mb4';
$password = "";
try {
$dbo = new PDO('mysql:host='.$dbhost_name.';dbname='.$database.';charset='.$charset.$username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
In my config.inc.php I set the following rules:
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server=utf8mb4
[client]
default-character-set=utf8mb4