This Domain(Admin5.com) is for Sale:

oracle database access object

时间:2007-12-23  来源:不详  作者:迈克DB

  
Calling example:
<?
$conn = OCILogon("www_cec", "webchn99", "unicorn");
#or you can just inclued file like "include("modcec_OCI_conn.php3");"

$newOda= new ODA($conn);
#################
#or you can use login method like this
#$newOda-=new ODA();
#$newOda->Logon("www","99","corn");
###############################################
$newOda->CmdString=" update test set nouse='dfs' where login_name='guoyafeng'";
if(!$newOda->Execute()) {
echo $newOda->err;
}
else
{
echo $newOda->Rows;#get the affected row number.
}
#or you can call execute like this####
/*
$newOda->Execute(" update test set nouse='dfs' where login_name='guoyafeng'"); dedecms.com
*/
#############################

#the following demostrate the open method.
$newOda->Open("select * from test")) or die $newOda->err;

#Get data from RS
echo "count is" .$newOda->Rows;
for($i=0;$i<$newOda->Rows;$i )
for($j=0;$j<$newOda->Cols;$j )
{
echo $newOda->RS[$i][$j];

}


$newOda->Logoff();
?>
<?
/********************************************************************************#
#File Name:ODA.
php3#
#Author:Guo Yafeng#
#Function: Oracle DB Access.#
#Maint History:#
#Sept 18,2000 first release.#
##
##
#********************************************************************************/


/********************************************************************************#

copyright dedecms


#Object interface description:#
#Properties:#
#connConnection Object#
#err_noError No#
#errError Description#
#CmdStringSQL Statements to execute.#
#RowsAffected Rows.#
#RSReturn value array.
#Cols#
##
#Method:#
#OpenExecute the CmdString and return value#
#ExecuteExecute the CmdString.#
#********************************************************************************/

file://$conn = OCILogon("www_ce", "ceonline99", "wsgp");
// $conn = OCILogon("www_cec", "webchn99", "unicorn");
//if ($SERVER_NAME == "")
//$SERVER_NAME = $HTTP_HOST;

class ODA
{




function ODA($cn="") {

if($cn!="")
$this->conn=$cn;
return TRUE;

}

function Logon($user,$pass,$db) {

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息