日期:2010-12-16  浏览次数:20429 次

 
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'");
*/
#############################

#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.                                            #
#                                                                                #
#                          &