mysql可通過(guò)兩種方式通過(guò)php與web相連,一種通過(guò)php的mysql相關(guān)函數(shù),另一種通過(guò)php的odbc相關(guān)函數(shù)
相關(guān)函數(shù)如下:
mysql函數(shù)
mysql_affected_rows: 得到 mysql 最后操作影響的列數(shù)目。
mysql_close: 關(guān)閉 mysql 伺服器連線。
mysql_connect: 開(kāi)啟 mysql 伺服器連線。
mysql_create_db: 建立一個(gè) mysql 新資料庫(kù)。
mysql_data_seek: 移動(dòng)內(nèi)部傳回指標(biāo)。
mysql_db_query: 送查詢字串 (query) 到 mysql 資料庫(kù)。
mysql_drop_db: 移除資料庫(kù)。
mysql_errno: 傳回錯(cuò)誤訊息代碼。
mysql_error: 傳回錯(cuò)誤訊息。
mysql_fetch_array: 傳回陣列資料。
mysql_fetch_field: 取得欄位資訊。
mysql_fetch_lengths: 傳回單列各欄資料最大長(zhǎng)度。
mysql_fetch_object: 傳回物件資料。
mysql_fetch_row: 傳回單列的各欄位。
mysql_field_name: 傳回指定欄位的名稱。
mysql_field_seek: 設(shè)定指標(biāo)到傳回值的某欄位。
mysql_field_table: 獲得目前欄位的資料表 (table) 名稱。
mysql_field_type: 獲得目前欄位的型態(tài)。
mysql_field_flags: 獲得目前欄位的旗標(biāo)。
mysql_field_len: 獲得目前欄位的長(zhǎng)度。
mysql_free_result: 釋放傳回占用記憶體。
mysql_insert_id: 傳回最后一次使用 insert 指令的 id。
mysql_list_fields: 列出指定資料表的欄位 (field)。
mysql_list_dbs: 列出 mysql 伺服器可用的資料庫(kù) (database)。
mysql_list_tables: 列出指定資料庫(kù)的資料表 (table)。
mysql_num_fields: 取得傳回欄位的數(shù)目。
mysql_num_rows: 取得傳回列的數(shù)目。
mysql_pconnect: 開(kāi)啟 mysql 伺服器長(zhǎng)期連線。
mysql_query: 送出一個(gè) query 字串。
mysql_result: 取得查詢 (query) 的結(jié)果。
mysql_select_db: 選擇一個(gè)資料庫(kù)。
mysql_tablename: 取得資料表名稱。
odbc函數(shù)
使用odbc函數(shù)需安裝mysql odbc
odbc_autocommit: 開(kāi)關(guān)自動(dòng)更動(dòng)功能。
odbc_binmode: 設(shè)定二進(jìn)位資料處理方式。
odbc_close: 關(guān)閉 odbc 連結(jié)。
odbc_close_all: 關(guān)閉所有 odbc 連結(jié)。
odbc_commit: 更動(dòng) odbc 資料庫(kù)。
odbc_connect: 連結(jié)至 odbc 資料庫(kù)。
odbc_cursor: 取得游標(biāo)名。
odbc_do: 執(zhí)行 sql 指令。
odbc_exec: 執(zhí)行 sql 指令。
odbc_execute: 執(zhí)行預(yù)置 sql 指令。
odbc_fetch_into: 取得傳回的指定列。
odbc_fetch_row: 取得傳回一列。
odbc_field_name: 取得欄位名稱。
odbc_field_type: 取得欄位資料形態(tài)。
odbc_field_len: 取得欄位資料長(zhǎng)度。
odbc_free_result: 釋出傳回資料的記憶體。
odbc_longreadlen: 設(shè)定傳回欄的最大值。
odbc_num_fields: 取得欄位數(shù)目。
odbc_pconnect: 長(zhǎng)期連結(jié)至 odbc 資料庫(kù)。
odbc_prepare: 預(yù)置 sql 指令。
odbc_num_rows: 取得傳回列數(shù)目。
odbc_result: 取得傳回資料。
odbc_result_all: 傳回 html 表格資料。
odbc_rollback: 撤消當(dāng)前交易。
odbc_setoption: 調(diào)整 odbc 設(shè)定。
新聞熱點(diǎn)
疑難解答