Anasayfa / TEKNOLOJİ / DERSLER / PHP ile Access Veritabanı Bağlantısı KODU

PHP ile Access Veritabanı Bağlantısı KODU

 

PHP ile Access Veritabanı Bağlantısı
——————————————————————————————–
<HTML>
<HEAD>
<TITLE> PHP – ADODB Bağlantısı </TITLE>
<META NAME=”Generator” CONTENT=”EditPlus”>
<META NAME=”Author” CONTENT=”idris katar”>
<META HTTP-EQUIV=”Content-Type” CONTENT=”text-html; charset=Windows-1254″>
</HEAD>

<BODY>
<?

// Connection
$conn = new COM(“ADODB.Connection”) or die(“ADODB başlatılamıyor”);
$conn->Open(“DRIVER={Microsoft Access Driver (*.mdb)};DBQ=rehber.mdb”);

// Recordset
$rs = $conn->Execute(“SELECT * FROM adres”);

// Alan isimlerini döküyoruz
echo “<TABLE border=’1′><TR><TH colspan=’6′>Veriler</TH><TR>”;
echo “<TR>”;
echo “<TH>” . $rs->Fields[0]->name . “</TH>”;
echo “<TH>” . $rs->Fields[1]->name . “</TH>”;
echo “<TH>” . $rs->Fields[2]->name . “</TH>”;
echo “<TH>” . $rs->Fields[3]->name . “</TH>”;
echo “<TH>” . $rs->Fields[4]->name . “</TH>”;
echo “<TH>” . $rs->Fields[5]->name . “</TH>”;
echo “</TR>”;

// Verileri döküyoruz
while (!$rs->EOF)
{
echo “<tr>”;
echo “<td>” . $rs->Fields[0]->value . ” </td>”;
echo “<td>” . $rs->Fields[1]->value . ” </td>”;
echo “<td>” . $rs->Fields[2]->value . ” </td>”;
echo “<td>” . $rs->Fields[3]->value . ” </td>”;
echo “<td>” . $rs->Fields[4]->value . ” </td>”;
echo “<td>” . $rs->Fields[5]->value . ” </td>”;
echo “</tr>”;
$rs->MoveNext();
}
echo “</TABLE>”;

// Kapanış
$rs->Close();
$conn->Close();

$rs->Release();
$conn->Release();

$rs = null;
$conn = null;

?>

</BODY>
</HTML>

 

Hakkında admin

Cevapla

E-posta adresiniz yayınlanmayacak. Gerekli alanlar işaretlenmelidir *

*

LÜTFEN GEREKLİ ALANI DOLDURUNUZ *

x

Check Also

PHP DÖVİZ KURLARI KODU

  $content = file_get_contents(“http://www.tcmb.gov.tr/kurlar/today.xml”); foreach($currency as $code => $arr){ preg_match(“‘<currency Kod=\”(“.$code.”)\”.*>(.*)</currency>’Uis”,$content,$crst); foreach($convert as $field => $value){ preg_match(“‘<“.$field.”>(.*)</”.$field.”>’Uis”,$crst[2],$frst); $currency[$code][$value] = $frst[1]; } }   $sen=”<pre>”.print_r($currency,true).”</pre>”; $sen1=str_replace(‘(‘,”,$sen); $sen2=str_replace(‘)’,”,$sen1); $sen3=str_replace(‘Array’,”,$sen2); $sen4=str_replace(‘[USD] =>’,”,$sen3); $sen5=str_replace(‘[EUR] ...