GB | BIG5
|
| 首頁 > 編程技術 > Php > 正文 |
 |
| PHP4手冊:函數庫及函數(一) Adabas D 資料庫連結函式庫 |
| http://netleader.126.com 星空浪子 (2001-04-16 17:28:28) |
--------------------------------------------------------------------------------
Adabas D 資料庫連結函式庫
--------------------------------------------------------------------------------
本函式庫共有 15 個函式
在使用 PHP 與資料庫的結合上,用 Adabas D 函式庫是較不好的方法,建議使用業界標準的 ODBC 函式庫取代 Adabas D 函式庫。
ada_afetch: 取得資料庫的傳回列。
ada_autocommit: 開關自動更動功能。
ada_close: 關閉 Adabas D 連結。
ada_commit: 更動 Adabas D 資料庫。
ada_connect: 連結至 Adabas D 資料庫。
ada_exec: 執行 SQL 指令。
ada_fetchrow: 取得傳回一列。
ada_fieldname: 取得欄位名稱。
ada_fieldtype: 取得欄位資料形態。
ada_freeresult: 釋出傳回資料的記憶體。
ada_numfields: 取得欄位數目。
ada_numrows: 取得傳回列數目。
ada_result: 取得傳回資料。
ada_resultall: 傳回 HTML 表格資料。
ada_rollback: 撤消當前交易。
--------------------------------------------------------------------------------
函式:ada_afetch()
--------------------------------------------------------------------------------
ada_afetch
取得資料庫的傳回列。
語法: int ada_afetch(int result_id, int rownumber, array result_array);
傳回值: 整數
函式種類: 資料庫功能
內容說明
將資料庫傳回的列資料 (row) 放入陣列變數中。參數 result_id 為資料庫傳回 ID 值。參數 rownumber 為指定的取得列 (row)。陣列參數 result_array 為取得列的資料陣列,通常在前面加上 "&" 符號。
參考
odbc_fetch_into()
--------------------------------------------------------------------------------
函式:ada_autocommit()
--------------------------------------------------------------------------------
ada_autocommit
開關自動更動功能。
語法: int ada_autocommit(int connection_id, int [OnOff]);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來開啟或關閉自動更新 (auto-commit) 功能。參數 connection_id 為資料庫連結的 ID 值。參數 OnOff 可省略,表開啟或關閉自動更動功能,內定值為 on,欲關閉則設 off。傳回值為目前的自動更新狀態,若開啟自動更新功能則傳回 true;若關閉自動更新功能則傳回 false。
參考
odbc_autocommit()
--------------------------------------------------------------------------------
函式:ada_close()
--------------------------------------------------------------------------------
ada_close
關閉 Adabas D 連結。
語法: void ada_close(int connection_id);
傳回值: 無
函式種類: 資料庫功能
內容說明
本函式用來關閉與 Adabas D 資料庫之間的連結。參數 connection_id 為資料庫連結代號 ID 值。若正在執行 transactions 則無法關閉連結。
參考
odbc_close()
--------------------------------------------------------------------------------
函式:ada_commit()
--------------------------------------------------------------------------------
ada_commit
更動 Adabas D 資料庫。
語法: int ada_commit(int connection_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來更動 (commit) Adabas D 資料庫。參數 connection_id 為資料庫連結的 ID 值。若有設定 ada_autocommit() 成自動更動資料庫時,則不需使用本函式。
參考
odbc_commit()
--------------------------------------------------------------------------------
函式:ada_connect()
--------------------------------------------------------------------------------
ada_connect
連結至 Adabas D 資料庫。
語法: int ada_connect(string dsn, string user, string password);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來連結到 Adabas D 資料庫,傳回值為連結的代號 ID 值。參數 dsn 為資料來源名稱 (Data Sources Name)。參數 user 及 password 分別為連結的帳號及密碼。
參考
odbc_connect()
--------------------------------------------------------------------------------
函式:ada_exec()
--------------------------------------------------------------------------------
ada_exec
執行 SQL 指令。
語法: int ada_exec(int connection_id, string query);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來執行 SQL 的 query 指令。參數 connection_id 為 Adabas D 連結代號 ID 值。參數 query 則為欲執行的指令。傳回值為 Result ID 值。
參考
odbc_exec()
--------------------------------------------------------------------------------
函式:ada_fetchrow()
--------------------------------------------------------------------------------
ada_fetchrow
取得傳回一列。
語法: int ada_fetchrow(int result_id, int [row_number]);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來取得 Query 的傳回資料的一列。參數 result_id 為 Adabas D 傳回 ID 值。參數 rownumber 可省略,為指定的取得列 (row)。
參考
odbc_fetch_row()
--------------------------------------------------------------------------------
函式:ada_fieldname()
--------------------------------------------------------------------------------
ada_fieldname
取得欄位名稱。
語法: string ada_fieldname(int result_id, int field_number);
傳回值: 字串
函式種類: 資料庫功能
內容說明
本函式用來取得 Query 的傳回資料的欄位名稱。參數 result_id 為 Adabas D 資料庫傳回 ID 值。參數 field_number 為指定的欄位,起始值為 1。
參考
odbc_field_name()
--------------------------------------------------------------------------------
函式:ada_fieldtype()
--------------------------------------------------------------------------------
ada_fieldtype
取得欄位資料形態。
語法: string ada_fieldtype(int result_id, int field_number);
傳回值: 字串
函式種類: 資料庫功能
內容說明
本函式用來取得 Query 的傳回資料的欄位資料形態。參數 result_id 為 Adabas D 傳回 ID 值。參數 field_number 為指定的欄位,起始值為 1。
參考
odbc_field_type()
--------------------------------------------------------------------------------
函式:ada_freeresult()
--------------------------------------------------------------------------------
ada_freeresult
釋出傳回資料的記憶體。
語法: int ada_freeresult(int result_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式可用來釋出傳回資料所使用的記憶體,通常在系統記憶體資源不足的情形下才需要使用。參數 result_id 為 Adabas D 傳回 ID 值。傳回值永遠都是 true。
參考
odbc_free_result()
--------------------------------------------------------------------------------
函式:ada_numfields()
--------------------------------------------------------------------------------
ada_numfields
取得欄位數目。
語法: int ada_numfields(int result_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來取得傳回資料的欄位數目。參數 result_id 為 Adabas D 傳回 ID 值。若發生錯誤則傳回 -1。
參考
odbc_num_fields()
--------------------------------------------------------------------------------
函式:ada_numrows()
--------------------------------------------------------------------------------
ada_numrows
取得傳回列數目。
語法: int ada_numrows(int result_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來取得傳回列的數目。參數 result_id 為 Adabas D 資料庫傳回 ID 值。若有錯誤發生則傳回 -1。
參考
odbc_num_rows()
--------------------------------------------------------------------------------
函式:ada_result()
--------------------------------------------------------------------------------
ada_result
取得傳回資料。
語法: string ada_result(int result_id, mixed field);
傳回值: 字串
函式種類: 資料庫功能
內容說明
本函式用來取得傳回的資料。參數 result_id 為 Adabas D 傳回 ID 值。參數 field 可以是數字形態,代表指定的欄位序號 (從 1 開始);亦可以是字串形態,為指定的欄位名稱。
參考
odbc_result()
--------------------------------------------------------------------------------
函式:ada_resultall()
--------------------------------------------------------------------------------
ada_resultall
傳回 HTML 表格資料。
語法: int ada_resultall(int result_id, string [format]);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來將取得的資料轉成 HTML 的表格 (table) 格式。參數 result_id 為 Adabas D 傳回 ID 值。參數 format 可省略,為表格的特殊設定值。傳回值為資料列數。
參考
odbc_result_all()
--------------------------------------------------------------------------------
函式:ada_rollback()
--------------------------------------------------------------------------------
ada_rollback
撤消當前交易。
語法: int ada_rollback(int connection_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式取消 Adabas D 交易處理 (transaction) 對資料庫所做的修改。若成功則傳回 true,反之傳回 false。
參考
odbc_rollback()
(http://www.fanqiang.com)
進入【UNIX論壇】
|
|
| 相關文章 |
PHP4手冊:函數庫及函數(四十六) SNMP 網管函式庫 (2001-04-18 16:56:55) PHP4手冊:函數庫及函數(四十五) Solid 資料庫連結函式庫 (2001-04-18 16:54:16) PHP4手冊:函數庫及函數(四十四) 信號與共享記憶體函式庫 (2001-04-18 16:49:09) PHP4手冊:函數庫及函數(四十三) 常規表示法函式庫 (2001-04-18 16:40:33) PHP4手冊:函數庫及函數(四十二) URL 處理函式庫 (2001-04-18 16:37:13) PHP4手冊:函數庫及函數(四十一) PostgreSQL 資料庫函式庫 (2001-04-18 15:58:12) PHP4手冊:函數庫及函數(四十) PDF 格式檔案函式庫 - 2 (2001-04-18 15:53:53) PHP4手冊:函數庫及函數(四十) PDF 格式檔案函式庫 - 1 (2001-04-18 15:53:35) PHP4手冊:函數庫及函數(三十九) Perl 相容語法函式庫 (2001-04-18 15:45:08) PHP4手冊:函數庫及函數(三十八) Oracle 資料庫函式庫 (2001-04-18 15:43:09)
|
===更多相關=== |
|
|
 |
★ 樊強制作 歡迎分享 ★ |