“PDO Tutup Koneksi” Kode Jawaban

Koneksi PHP PDO

$host     = "localhost";//Ip of database, in this case my host machine    
$user     = "root";	//Username to use
$pass     = "qwerty";//Password for that user
$dbname   = "DB";//Name of the database

try {
    $connection = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
    $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

}catch(PDOException $e)
{
  echo $e->getMessage();                         
}
Phil the ice cream man

PDO Tutup Koneksi

$conn=new PDO("mysql:host=$host;dbname=$dbname",$user,$pass);
    // If this is your connection then you have to assign null
    // to your connection variable as follows:
$conn=null;
    // By this way you can close connection in PDO.
Borma

Tutup koneksi PDO

$pdo = null;
effset

Jawaban yang mirip dengan “PDO Tutup Koneksi”

Pertanyaan yang mirip dengan “PDO Tutup Koneksi”

Lebih banyak jawaban terkait untuk “PDO Tutup Koneksi” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya