日期:2014-01-11  浏览次数:20438 次

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