<?php
$hostname = 'localhost';
$username = 'root';
$password = 'indonesia';
try{
$db = new PDO("mysql:host=$hostname;dbname=a", $username, $password);
echo 'Connected to database';
$db = null;
}catch(PDOException $e){
echo $e->getMessage();
}
$hostname = 'localhost';
$username = 'root';
$password = 'indonesia';
try{
$db = new PDO("mysql:host=$hostname;dbname=a", $username, $password);
echo 'Connected to database';
$db = null;
}catch(PDOException $e){
echo $e->getMessage();
}
No comments:
Post a Comment