lyxcf
中级会员
 
UID 78421
精华
0
积分 309
帖子 205
金钱 309 喜悦币
威望 0
人脉 0
阅读权限 30
注册 2006-8-16 来自 北京 角门北路
状态 离线
|
[推荐阅读] 请问像记住用户,在2次访问时免登陆是怎么实现的
回复 #1 taipinglang 的帖子
<?php $host=""; $port="1521"; $sid=""; $cstr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$host)(PORT=$port))(CONNECT_DATA=(SID=$sid)))";
$db_conn = ocilogon("name", "pw",$cstr);
$cmdstr = "select ename from scott.emp order by ename desc";
$parsed = ociparse($db_conn, $cmdstr); ociexecute($parsed);
$nrows = ocifetchstatement($parsed, $results);
echo "<html><head><title>Oracle PHP Test</title></head><body>"; echo "<center><h2>Oracle PHP Test</h2><br>"; echo "<table border=1 cellspacing='0' width='50%'>n<tr>n"; echo "<td><b>Name</b></td>n<td><b>Salary</b></td>n</tr>n";
for ($i = 0; $i < $nrows; $i++ ) { echo "<tr>n"; echo "<td>" . $results["ENAME"][$i] . "</td>"; echo "<td>$ " . number_format($results["SAL"][$i], 2). "</td>"; echo "</tr>n";
}
echo "<tr><td colspan='2'> Number of Rows: $nrows</td></tr></table>"; echo "<br><em>If you see data, then it works!</em><br></center></body></html>n";
?>
|
|