PHP ile Access Veri Tabanına Bağlanma

PHP ile Access Veri Tabanına Bağlanma  
<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>
 

Kaynak  www.sanalkurs.net/derssayfa14-3.html
Yorumunuzu Ekleyin


Yükleniyor...
Yükleniyor...