php链接oracle数据库

php链接oracle数据库
[quote]我曾经装过10G的php连接ord。
程序运行必须步骤如下
1.安装orl client

2.修改php.ini,打开php_oci.dll等扩展dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
extension=php_oci8.dll
extension=php_oracle.dll
@header("Content-Type: text/html; charset=gb2312");

$conn = oci_connect('name', 'pass', 'ordclientdbname','ZHS16GBK');//SIMPLIFIED CHINESE_CHINA.ZHS16GBK AMERICAN.UTF8
if (!$conn) {
$e = oci_error();
print htmlentities($e['log_Content']);
exit;
}

$query = 'SELECT * FROM taobaogoods';

$stid = oci_parse($conn, $query);
if (!$stid) {
$e = oci_error($conn);
print htmlentities($e['log_Content']);
exit;
}

$r = oci_execute($stid, OCI_DEFAULT);
if(!$r) {
$e = oci_error($stid);
echo htmlentities($e['log_Content']);
exit;
}

print '';
$i =0;
while($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
print '';

foreach($row as $item) {
// if($i ==3)echo "";

print '';
//print '';
}
$i++;
//exit;
print '';
}
print '
'.($item ? $item:' ').''.($item ? iconv('utf-8','gb2312',htmlentities($item)):' ').'
';

oci_close($conn);
exit;[/quote]


目前有:0条评论

留下脚印,证明你来过。发表评论:

*

*

分享:

支付宝

微信