示例 #2 使用连接字符串的 PDO_INFORMIX DSN 示例
为了正常工作,DSN 连接字符串中不能有换行符。
<?php
$conexion = new PDO("informix:host=host.domain.com; service=9800;
database=common_db; server=ids_server; protocol=onsoctcp;
EnableScrollableCursors=1", "testuser", "tespass");
$sql = "SELECT * FROM test";
$prep = $conexion->prepare($sql);
$prep->execute();
$result = $prep->fetchAll(PDO::FETCH_ASSOC);
var_dump($result);
?>