标题: PHP网站制作之oracle database access object [打印本页] 作者: 精灵巫婆 时间: 2015-2-4 00:25 标题: PHP网站制作之oracle database access object 咱们就开始学习动态语言的概念吧,刚一接触动态语言,可能很多人都会蒙了,怎么这乱七八糟的东西,在网页里显示的时候却是另外一码事?其实这并不算乱七八糟,你写的HTML代码不也一样是一堆堆的字符吗?毕竟,代码并不是作为直接输出的,而是经过处理的,说白了,HTML是经过HTML解析器,而PHP当然也就通过PHP解析器了,跟学习HTML一样的道理,想让任何的解析器完成操作,就必须使用它们专用的语法结构,所以PHP长相奇怪也就不足为奇了。access|object|oracle
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];