<?php
$server="localhost";
$user="root";
$pass="";
$dbname="expert";
$dsn="mysql:host=$server;dbname=$dbname";
try {
$connect=new PDO($dsn,$user,$pass);
$connect->exec("SET character_set_connection ='utf8mb4'");
$connect->exec("SET NAMES ='UTF8'");
}
catch (PDOException $error){
echo ("unable to connect".$error->getMessage());
}
?>
unable to connectSQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1