那会不会是因为你的PHP环境还没配置好呢?
解决方案 »
- 如何配置openssl apache+windows
- 一直很疑惑的问题:LAMP的搭配关系到底是怎样的?
- 菜鸟写的留言板登陆代码各位大神帮我看看,为什么要点击登陆两次才能登陆,为什么要点击两次退出才能退出?
- 不显示mysql错误提示
- 顺时针方向打印矩阵
- 配置php.ini没成功,连不上mysql
- php怎么帮定2级域名,用在在线建站。“http://用户名.我的域名”访问他自己的网站摸斑,怎么做?
- 文件上传后,怎么让它自动解压缩?谁有这方面的代码
- 求救:关于PHP的绝对路径(在线等)
- php4中mysql的配置及与session的调和,急!!!
- 在什么样的print里面可以使用php语句?
- 好奇怪的函数调用问题???
Defination of ORACLE db CLASS and ORACLE query CLASS
Author: Likai
*/
if ( !defined( "_ORACLE_CLASS" ) )
{
define("_ORACLE_CLASS", 1 );
/*
ORACLE database class
function open :open oraclass database connection
function close: close the database connection and free the smtm
function addqury: add the smtm ready for free
*/
class ora_db
{
var $connect_id; //function to open ORACLE database
function open($database, $user, $password)
{
$this->connect_id = OCILogon($user, $password, $database);
if( $this->connect_id )
return $this->connect_id;
else
return FALSE;
}
// Closes the database connection and frees any query results left.
function close()
{
if($this->stmt_id && is_array($this->stmt_id))
{
while (list($key,$val)=each($this->stmt_id))
{
@OCIFreeStatement($val) ;
}
} $result = OCILogoff($this->connect_id);
return $result; } // Function used by the constructor of query.
function addstmt($stmt_id)
{
$this->stmt_id[]=$stmt_id;
}
} /* End of Defination of ORACLE db Class */ /*
Defination of ORACLE query Class */ class ora_query
{
var $row;
var $smtm;
var $bind_data; //new a query and directly execute the normal query
function ora_query(&$db, $query="")
{ if($query!=""&&$db->connect_id)
{
$this->stmt = OCIParse($db->connect_id, $query);
if (!$this->stmt)
{
return false;
}
if (OCIExecute($this->stmt))
{
$db->addstmt($this->stmt);
return $this->stmt;
}
OCIFreeStatement($this->stmt);
return false;
}
else
return FALSE;
} /*
before execute the query ,BIND the query with the php extern variables
for example $query = "insert into ? values(?,'?',?,0)
then the function analye the string
*/ function prepare(&$db,$query="")
{
$pieces = explode( "?", $query);
$new_query = ""; $last_piece = sizeof($pieces) - 1;
while (list($i, $piece) = each($pieces))
{
$new_query .= $piece;
if ($i < $last_piece)
{
$new_query .= ":var$i";
}
} print "<br>new_query=$new_query\n<br>";
//for debug $this->stmt = OCIParse($db->connect_id, $new_query);
if (!$this->stmt)
{
return false;
} for ($i = 0; $i < $last_piece; $i++)
{
$bindvar = ":var$i";
if (!OCIBindByName($this->stmt, $bindvar, &$this->bind_data[$i],32))
{
OCIFreeStatement($this->stmt);
return FALSE;
}
}
return $this->stmt; } //after prepare query then execute the query
function execute(&$db,$data)
{ while (list($i, $value) = each($data))
{
$this->bind_data[$i] = $data[$i];
echo $this->bind[$i];
} if (OCIExecute($this->stmt))
{
$db->addstmt($this->stmt);
return $this->stmt;
}
return FALSE; } // fetch the next row of stmt
function getrow()
{
if(!OCIFetchInto($this->stmt, &$this->row,OCI_RETURN_NULLS))
{
return FALSE;
}
// var_dump($this->row);
return $this->row;
} // get the number of rows of $stmt
function numrows()
{
$number=OCIRowCount($this->stmt) ;
return $number;
} //get oracle runtime error
function error()
{
$error=OCIError($this->stmt);
if( $error )
return $errot;
else
return OCIError($db->connect_id); }
}
/* End of Defination of ORACLE query Class */
} /*End ifdefined */ //example:
/*
$DB = new ora_db;
$DB->open("oralinux","oralinux","jordan");
$q = "Select * from aa";
$test_query = new ora_query($DB,$q); while($test_query->getrow())
{
echo "<br>编号:".$test_query->row[0];
echo "<br>姓名:".$test_query->row[1];
echo "<br>地址:".$test_query->row[2];
echo "<br> ".$test_query->row[3];
}
$q = "Insert into aa values(?,?,?,?)";
$data[] = "1";
$data[] = "张三";
$data[] = "广东";
$data[] = "广州"; $test_query->prepare($DB,$q);
$test_query->execute($DB,$data);
$DB->close();
*/
?>
打开了。下面是出的错误!
Fatal error: Call to undefined function: ocilogon() in D:\tads_web\gongshang\adodb\drivers\adodb-oci8.inc.php on line 141