<?php
$DBhost= 'localhost';
$DBuser= 'root';
$DBpass= ' ';
$DBname= 'randevu';
try{
$baglanti = new PDO("mysql:host={$DBhost};dbname={$DBname}", $DBuser,$DBpass);
$baglanti->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e){
echo $e->getMessage();
}
?>
Not: kodlamalar hepsi php uzantısında olmalıdır. burada bağlantı dosyasının adını biz dbconfig.php olarak belirledik
Hiç yorum yok:
Yorum Gönder