Closed deawx closed 2 years ago
OK used
try {
$testconnect = new medoo([
'type' => "mysql",
'server' => "127.0.0.1",
'username' => "sa",
'password' => "",
'database_name' => "mydatabase",
'port' => 3306,
'charset' => "utf8",
]);
} catch (PDOException $e) {
$errors = $e->getMessage();
$x = explode(" ", $errors);
$a = strlen($x[0]);
$b = strlen($x[1]);
$sublen = $a + $b + 1;
echo "ERROR MSG => ".substr($errors, $sublen);
exit();
}
how to check connection is connect or false message.