oci_connect
2019. 5. 16. 15:59ㆍdeveloper
<?php
// Connects to the XE service (i.e. database) on the "localhost" machine
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$stid = oci_parse($conn, 'SELECT * FROM employees');
oci_execute($stid);
echo "<table border='1'>\n";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo "<tr>\n";
foreach ($row as $item) {
echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
?>
'developer' 카테고리의 다른 글
| phpize로 공유 PECL 확장모듈 컴파일하기 (0) | 2019.05.16 |
|---|---|
| pecl 명령을 사용하여 공유 PECL 확장모듈을 컴파일 하기 (0) | 2019.05.16 |
| PECL 확장모듈 다운로드 (0) | 2019.05.16 |
| oci_fetch_array (0) | 2019.05.16 |
| mysql_affected_rows (0) | 2019.05.16 |