GB | BIG5
|
| 首頁 > 編程技術 > Php > 正文 |
 |
| PHP4手冊:函數庫及函數(四十五) Solid 資料庫連結函式庫 |
| http://netleader.126.com 星空浪子 (2001-04-18 16:54:16) |
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
--------------------------------------------------------------------------------
本函式庫共有 10 個函式
理論上,使用標準的 ODBC 會比使用本函式好。當然也可以使用本函式,只是較不鼓勵 Solid 函式庫。
solid_close: 關閉 solid 連結。
solid_connect: 連結至 solid 資料庫。
solid_exec: 執行 SQL 指令。
solid_fetchrow: 取得傳回一列。
solid_fieldname: 取得欄位名稱。
solid_fieldnum: 取得欄位數目。
solid_freeresult: 釋出傳回資料的記憶體。
solid_numfields: 取得欄位數目。
solid_numrows: 取得傳回列數目。
solid_result: 取得傳回資料。
--------------------------------------------------------------------------------
函式:solid_close()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_close
關閉 solid 連結。
語法: void solid_close(int connection_id);
傳回值: 無
函式種類: 資料庫功能
內容說明
本函式用來關閉與 solid 資料庫之間的連結。參數 connection_id 為 solid 連結代號 ID 值。若正在執行 transactions 則無法關閉連結。
--------------------------------------------------------------------------------
函式:solid_connect()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_connect
連結至 solid 資料庫。
語法: int solid_connect(string dsn, string user, string password, int [cursor_type]);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來連結到 solid 資料庫,傳回值為連結的代號 ID 值。參數 dsn 為資料來源名稱 (Data Sources Name)。參數 user 及 password 分別為連結的帳號及密碼。參數 cursor_type 通常省略,其值有 SQL_CUR_USE_IF_NEEDED、SQL_CUR_USE_ODBC、SQL_CUR_USE_DRIVER 及 SQL_CUR_DEFAULT 等四種。當使用復雜的資料存取時可能會有類似 "Cannot open a cursor on a stored procedure that has anything other than a single select statement in it" 的錯誤訊息字串,此時若將參數 cursor_type 的值設為 SQL_CUR_USE_ODBC 就可以避開了。
--------------------------------------------------------------------------------
函式:solid_exec()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_exec
執行 SQL 指令。
語法: int solid_exec(int connection_id, string query);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來執行 SQL 的 query 指令。參數 connection_id 為 ODBC 連結代號 ID 值。參數 query 則為欲執行的指令。傳回值為 Result ID 值。
--------------------------------------------------------------------------------
函式:solid_fetchrow()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_fetchrow
取得傳回一列。
語法: int solid_fetchrow(int result_id, int [row_number]);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來取得 Query 的傳回資料的一列。參數 result_id 為 ODBC 傳回 ID 值。參數 rownumber 可省略,為指定的取得列 (row)。
--------------------------------------------------------------------------------
函式:solid_fieldname()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_fieldname
取得欄位名稱。
語法: string solid_fieldname(int result_id, int field_number);
傳回值: 字串
函式種類: 資料庫功能
內容說明
本函式用來取得 Query 的傳回資料的欄位名稱。參數 result_id 為 solid 傳回 ID 值。參數 field_number 為指定的欄位,起始值為 1。
--------------------------------------------------------------------------------
函式:solid_fieldnum()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_fieldnum
取得欄位數目。
語法: int solid_fieldnum(int result_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來取得傳回資料的欄位數目。參數 result_id 為 solid 傳回 ID 值。若發生錯誤則傳回 -1。
--------------------------------------------------------------------------------
函式:solid_freeresult()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_freeresult
釋出傳回資料的記憶體。
語法: int solid_freeresult(int result_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式可用來釋出傳回資料所使用的記憶體,通常在系統記憶體資源不足的情形下才需要使用。參數 result_id 為 solid 傳回 ID 值。傳回值永遠都是 true
--------------------------------------------------------------------------------
函式:solid_numfields()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_numfields
取得欄位數目。
語法: int solid_numfields(int result_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來取得傳回資料的欄位數目。參數 result_id 為 solid 傳回 ID 值。若發生錯誤則傳回 -1。
--------------------------------------------------------------------------------
函式:solid_numrows()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_numrows
取得傳回列數目。
語法: int solid_numrows(int result_id);
傳回值: 整數
函式種類: 資料庫功能
內容說明
本函式用來取得傳回列的數目。參數 result_id 為 solid 傳回 ID 值。若有錯誤發生則傳回 -1。
--------------------------------------------------------------------------------
函式:solid_result()
--------------------------------------------------------------------------------
Solid 資料庫連結函式庫
solid_result
取得傳回資料。
語法: string solid_result(int result_id, mixed field);
傳回值: 字串
函式種類: 資料庫功能
內容說明
本函式用來取得傳回的資料。參數 result_id 為 solid 傳回 ID 值。參數 field 可以是數字形態,代表指定的欄位序號 (從 1 開始);亦可以是字串形態,為指定的欄位名稱。
(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)
|
===更多相關=== |
|
|
 |
★ 樊強制作 歡迎分享 ★ |