Skip to content

PDO示例

$connStr = "odbc:DSN=XuguDB;";
$pdo = new PDO($connStr);
$stmt = $pdo->prepare("select * from mytable where id = :id");
$stmt->bindValue(":id", 1);
$stmt->execute();
while($row = $stmt->fetch()) {
    echo $row["ID"] . "\n";
}