(1)integer ora_logon(string user , string password)

開始對一個Oracle數(shù)據(jù)庫服務器的連接。

(2)intege " /> 中文字幕天天躁日日躁狠狠躁免费 ,成 人 免 费 黄 色,成人欧美一区二区三区

一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

PHP調用三種數(shù)據(jù)庫的方法(3)

Oracle(甲骨文)是世界上最為流行的關系數(shù)據(jù)庫。它是大公司推崇的工業(yè)化的強有力的引擎。我們先看看其相關的函數(shù):

(1)integer ora_logon(string user , string password)

開始對一個Oracle數(shù)據(jù)庫服務器的連接。

(2)integer ora_open(integer connection)

打開給出的連接的游標。

(3)integer ora_do(integer connection, string query)

在給出的連接上執(zhí)行查詢。php生成一個指示器,解析查詢,并執(zhí)行之。

(4)integer ora_parse(integer cursor, string query)

解析一個查詢并準備好執(zhí)行。

(5)boolean ora_exec(integer cursor)

執(zhí)行一個先前由ora_parse函數(shù)解析過的查詢。

(6)boolean ora_fetch(integer cursor)

此函數(shù)會使得一個執(zhí)行過的查詢中的行被取到指示器中。這使得您可以調用ora_getcolumn函數(shù)。

(7)string ora_getcolumn(integer cursor, integer column)

返回當前的值。列由零開始的數(shù)字索引。

(8)boolean ora_logoff(integer connection)

斷開對數(shù)據(jù)庫服務器的鏈接。

以下是向ORACLE數(shù)據(jù)庫插入數(shù)據(jù)的示例程序:

<html>

<head><title>向ORACLE數(shù)據(jù)庫中插入數(shù)據(jù)</title></head>

<body>

<form action="<?echo $php_SELF;?>" method="post">

<table border="1" cellspacing="0" cellpadding="0">

<tr>

<th>ID</th>

<th>name</th>

<th>Description</th>

</tr>

<tr>

<td><input type="text" name="name" maxlength="50" size="10"></td>

<td><input type="text" name="email" maxlength="255" size="30"></td>

<td><input type="text" name="Description" maxlength="255" size="50"></td>

</tr>

<tr align="center">

<td colspan="3"><input type="submit" value="提交">  <input type="reset" value="重寫"></td>

</tr>

</table>

</form>

<?

//先設置兩個環(huán)境變量ORACLE_HOME,ORACLE_SID

putenv("ORACLE_HOME=/oracle/app/oracle/product/8.0.4");

putenv("ORACLE_SID=ora8");

//設置網頁顯示中文

putenv("NLS_LANG=Simplified_Chinese.zhs16cgb231280");

if($connection=ora_logon("scott","tiger")) {

//庫表test有ID,name,Description三項

$sql = 'insert into test(ID,name,Description) values ';

$sql .= '('' . $ID . '','' . $name . '',''. $Description . '')';

if($cursor=ora_do($connect,$sql)) {

print("insert finished!");

}

$query = 'select * from test';

if($cursor=ora_do($connect,$query)) {

ora_fetch($cursor);

$content0=ora_getcolumn($cursor,0);

$content1=ora_getcolumn($cursor,1);

$content2=ora_getcolumn($cursor,2);

print("$content0");

print("$content1");

print("$content2");

ora_close($cursor);

}

ora_logoff($connection);

}

?>

</body>

</html>

php技術PHP調用三種數(shù)據(jù)庫的方法(3),轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 精品专区| 久久久91精品国产一区二区三区 | 国产丝袜美腿高跟白浆 | 亚洲精品tv久久久久久久久 | 欧美人与禽交片在线观看网站 | 久久成人免费网站 | 狠狠色丁香久久综合五月 | 福利一区二区视频 | 免费99精品国产自在现线观看 | 亚洲成人福利在线观看 | 天天色综合5 | 久久免费特黄毛片 | 性久久久久久 | 亚洲激情网站 | 中文字幕一区二区三区 精品 | 在线日本妇人成熟免费观看 | 成人免费午夜视频 | 国产精品免费福利 | 久久国产自偷自偷免 | h亚洲| 亚洲精品影视 | 巨臀中文字幕一区二区翘臀 | 人人公开免费超级碰碰碰视频 | 在线婷婷 | 涩婷婷| 黄色网页在线播放 | 高清欧美在线三级视频 | 色综合久久88色综合天天 | 国产成人啪精品视频免费网站软件 | 国产成人激烈叫床声视频对白 | 无遮挡一级毛片性视频不卡 | 精品中文字幕在线观看 | 亚洲精品国产啊女成拍色拍 | 亚洲欧美性视频 | www视频在线播放 | 午夜视频一区二区 | 久久这里一区二区精品 | 久久久亚洲欧洲日产国码二区 | 中文字幕一二区 | 国产手机精品自拍视频 | 亚洲图片一区二区三区 |