另外重新装了一个8.05版的oracle数据库,但是连接不上出现如下错误: Warning: Unable to connect to ORACLE (Error while trying to retrieve text for error ORA-12154) in /data/httpd/htdocs/news/oracle.php3 on line 9oracle.php3文件中第9 行为: $count = ora_plogon("user@sid","password") or die; $rs = ora_open($count); ora_commitoff($count);请这是什么原因?用户名口令和SID都是正确。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>个人评论</title>
</head>
<?php
putenv("NLS_LANG=NLS_LANG=american_america.ZHS16GBK");
include("hailang.css");
include("oracle.php3");$OracleDBConn = OCILogon($oracleuser,$oraclepassword,$sid);
$sql_count="select Count(*) from review where trueorfales='true' ORDER BY id DESC";
$row_count=OCIParse($OracleDBConn, $sql_count);
OCIExecute($row_count);if (OCIFetch($row_count)) {
$num_rows = OCIResult($row_count,1);
} else {
$num_rows = 0;
}OCIFreeStatement($row_count);if (empty($page) || $page == 0) {
$page = 1;
}
$start_range = (($page - 1) * $display_rows) + 1;
$end_range = $page * $display_rows;
?>
<body bgcolor="#F0F0F0">
<form name="form1" method="post" action="appear_next.php3">
<table width="700" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#003399"> <div align="center"><font color="#FFFFFF">主题:<?php echo("$title");?></font></div></td>
</tr>
<tr> </tr>
<tr>
<td height="20">
<table width="698" border="0" cellpadding="0" cellspacing="0">
<?php
if ($num_rows != 0)
{
putenv("NLS_LANG=american_america.ZHS16GBK");
$OracleDBConn2 = OCILogon($oracleuser,$oraclepassword,$sid);
$sql_count2="select * from review where trueorfales='true' ORDER BY id DESC";
$row_count2=OCIParse($OracleDBConn, $sql_count2);
OCIExecute($row_count2);
$num_columns = OCINumCols($row_count2); while (OCIFetch($row_count2))
{ $id[]=OCIResult($row_count2,1);
$username[]=OCIResult($row_count2,2);
$title2[]=OCIResult($row_count2,3);
$text[]=OCIResult($row_count2,4);
$ipaddress[]=OCIResult($row_count2,5);
$time[]=OCIResult($row_count2,6);
//$trueorfales[]=OCIResult($row_count2,7);
}
//------------------------------------------------------------------------------------
if ($num_rows % $display_rows == 0)
{
$total_pages = $num_rows / $display_rows;
}
else
{
$total_pages = ($num_rows / $display_rows) + 1;
settype($total_pages, integer);
}
//-------------------------------------------------------------------------------------
if ($page!="")
{
$page = $page;
}
else
{
$page = 0;
}
$i=0;
$t=count($username);
$start=$display_rows*$page-1;
$end=$start+$display_rows;
if($end>$t)
$end=$t;
for($start;$start<$end;$start++)
{
if($i%2==1)
{
echo(" <tr><td bgcolor=cccccc width=\"100\" align=right>$username[$start]".":</td><td bgcolor=cccccc>"."$text[$start]<font size=2 color=F0F0F0>$time[$start]</font></td></tr>");
}
else
{
echo(" <tr><td width=\"100\" align=right>$username[$start]".":</td><td>"."$text[$start]<font size=2 color=cccccc>$time[$start]</font></td></tr>");
}
$i++;
}
OCIFreeStatement($row_count2);
} else {
echo "<tr><td align=center>Sorry! 现在没有评论!</td></tr>";
}OCILogoff($OracleDBConn);
OCILogoff($OracleDBConn2);?> </table>
</td>
</tr>
<tr>
<td>
<div align="center"><font color="#0033CC" size="2">
<?php
if ($page > 1) {
echo "<a href='".$PHP_SELF."?page=".($page - 1)."&title=$title'>上一页</a>";
}for ($p = 1; $p <= $total_pages; $p++) {
if ($page == $p){
echo " ".$p;
} else {
echo " <a href='".$PHP_SELF."?page=".$p."&title=$title'>".$p."</a>";
}
}
if ($page < $total_pages) {
echo " <a href='".$PHP_SELF."?page=".($page + 1)."&title=$title'>下一页</a>";
}?>
</font></div></td>
</tr>
<tr>
<td bgcolor="#003399"> <div align="center"><font color="#FFFFFF">添加我的意见添加我的意见</font></div></td>
</tr>
<tr>
<td><div align="center">用户名称
<input name="username" type="text" id="username" size="11" maxlength="11">
<font color="#FF0000">*</font> 回应主题
<input name="title" type="text" id="title" size="50" maxlength="50" value="回复:<?php echo("$title");?>">
<font color="#FF0000">*</font></div></td>
</tr>
<tr>
<td><div align="center">
<textarea name="text" cols="80" rows="10" id="text"></textarea>
</div></td>
</tr>
<tr>
<td height="144"><font color="#0033CC">在发表评论之前您必须仔细阅读并同意下列条款:</font><br>
<font color="#0033FF">*</font>尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》和《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。
<br> <font color="#0033FF">*</font>严禁发表危害国家安全、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的作品
<br> <font color="#0033FF">*</font>承担一切因您的行为而直接或间接导致的民事或刑事法律责任 <br> <font color="#0033FF">*</font>本站有权保留或删除论坛中的任意内容,有权在网站内免费转载或引用论坛帖子
<br> <font color="#0033FF">*</font>本贴提交者发言纯属个人意见,与本网站立场无关。 </td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="Submit" value=" 提 交 ">
<input type="reset" name="Submit2" value=" 清 除">
</div></td>
</tr>
</table>
</form>
</body>
</html>
Warning: Unable to connect to ORACLE (Error while trying to retrieve text for error ORA-12154) in /data/httpd/htdocs/news/oracle.php3 on line 9oracle.php3文件中第9 行为:
$count = ora_plogon("user@sid","password") or die;
$rs = ora_open($count);
ora_commitoff($count);请这是什么原因?用户名口令和SID都是正确。