There are currently 3 posts.
Font size: Small - 100% (Default)▼  Content converter: No conversion▼
 
Clicks Replies
1628 2
【示例】PHP連接Access 2010數據庫
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 1 Posted at: 11/5/15 18:05
<?php
$filename = 'D:\Codes\Databases\Access\test.accdb';
$dbh = new PDO("odbc:driver={microsoft access driver (*.mdb, *.accdb)};dbq=$filename");
$sql = 'SELECT * FROM Items';
$stmt = $dbh->prepare($sql);
$stmt->execute();
foreach ($stmt as $row) {
    print_r($row);
    echo '<br>';
}
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 2 Posted at: 11/5/15 18:05
輸出:
Array ( [ItemID] => 1 [0] => 1 [ItemName] => Android [1] => Android [TimeCreated] => 2015-11-05 13:01:11 [2] => 2015-11-05 13:01:11 )
Array ( [ItemID] => 2 [0] => 2 [ItemName] => PHP [1] => PHP [TimeCreated] => 2015-11-05 13:01:16 [2] => 2015-11-05 13:01:16 )
fengtianru117
见习魔法师 二级
Reply
Floor 3 Posted at: 11/5/15 19:01
男神太6了
Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
(Shortcut key: Ctrl+Enter)
Post Information
Clicks: 1628 Replies: 2
Author: 巨大八爪鱼
Last reply: fengtianru117
Last reply time: 11/5/15 19:01
Bar Hot Posts
Announcements