<?php
$host = "localhost";
$dbname = "id8452667_shop";
$username = "id8452667_root";
$password = "andimahyudin95";
try {
$conn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();
}
try {
$host = "localhost";
$dbname = "id8452667_shop";
$username = "id8452667_root";
$password = "andimahyudin95";
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
} catch (PDOException $e) {
die("Could not connect to the database $dbname :" . $e->getMessage());
}
?>
$host = "localhost";
$dbname = "id8452667_shop";
$username = "id8452667_root";
$password = "andimahyudin95";
try {
$conn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();
}
try {
$host = "localhost";
$dbname = "id8452667_shop";
$username = "id8452667_root";
$password = "andimahyudin95";
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
} catch (PDOException $e) {
die("Could not connect to the database $dbname :" . $e->getMessage());
}
?>
No comments:
Post a Comment