mysqli類的對象和其屬性方法;mysqli類面向過程的屬性和方法


mysqli 方法的概述
mysqli 類
面向對象接口 面向過程接口   描述

屬性

$mysqli::affected_rows mysqli_affected_rows() 獲取上次 Mysql 操作受影響的行數
$mysqli::client_info mysqli_get_client_info() 返回 Mysql 客戶端版本信息,類型為 string
$mysqli::client_version mysqli_get_client_version() 返回 Mysql 客戶端版本信息,類型為 integer
$mysqli::connect_errno mysqli_connect_errno() 返回最后一次連接數據庫的錯誤代碼
$mysqli::connect_error mysqli_connect_error() 返回最后一次連接數據庫的錯誤描述,類型為字符串
$mysqli::errno mysqli_errno() 返回最近一次函數調用所產生的錯誤代碼
$mysqli::error mysqli_error() 返回最近一次錯誤代碼的描述,類型是字符串
$mysqli::field_count mysqli_field_count() 返回最近一次查詢中,包含的列的數量
$mysqli::host_info mysqli_get_host_info() 返回字符串,表示數據庫連接所使用的類型
$mysqli::protocol_version mysqli_get_proto_info() 返回使用的 MySQL 協議的版本信息
$mysqli::server_info mysqli_get_server_info() 返回 MySQL 服務器的版本
$mysqli::server_version mysqli_get_server_version() 返回 MySQL 服務器的版本,類型為 integer
$mysqli::info mysqli_info() 獲取最近一次數據庫查詢的信息
$mysqli::insert_id mysqli_insert_id() 返回上次查詢中所使用的自動生成的 ID
$mysqli::sqlstate mysqli_sqlstate() 返回上次 MySQL 操作的數據庫狀態錯誤(SQLSTATE error)
$mysqli::warning_count mysqli_warning_count() 根據數據庫鏈接,返回最后一次數據庫查詢內警告的數量

方法

mysqli::autocommit() mysqli_autocommit() 打開或關閉數據庫的自動提交(auto-committing)功能
mysqli::change_user() mysqli_change_user() 更改指定數據庫連接所使用的用戶
mysqli::character_set_name(),mysqli::client_encoding mysqli_character_set_name() 返回數據庫連接的默認字符集
mysqli::close() mysqli_close() 關閉先前打開的數據庫連接
mysqli::commit() mysqli_commit() 提交當前的數據庫事務
mysqli::__construct() mysqli_connect() 打開新連接到 MySQL 服務器[注意:靜態方法]
mysqli::debug() mysqli_debug() 執行調試操作
mysqli::dump_debug_info() mysqli_dump_debug_info() 將調試信息轉儲到日志中
mysqli::get_charset() mysqli_get_charset() 返回包含字符集信息的對象
mysqli::get_connection_stats() mysqli_get_connection_stats() 返回客戶端連接的統計信息。僅可用於 mysqlnd
mysqli::get_client_info() mysqli_get_client_info() 返回 MySQL 客戶端版本的字符串信息
mysqli::get_client_stats() mysqli_get_client_stats() 返回每個客戶端進程的統計信息。 僅可用於 mysqlnd
mysqli::get_cache_stats() mysqli_get_cache_stats() 返回客戶端的 Zval 緩存統計信息。 僅可用於 mysqlnd
mysqli::get_server_info() mysqli_get_server_info() 返回 MySQLi 連接上的 MySQL 服務器的版本字符串
mysqli::get_warnings() mysqli_get_warnings() 文檔暫缺
mysqli::init() mysqli_init() 初始化 MySQLi,返回資源類型的值,可供 mysqli_real_connect 使用。 [不要在對象上調用,它返回了 $mysqli 對象]
mysqli::kill() mysqli_kill() 請求服務器殺死一個 MySQL 線程
mysqli::more_results() mysqli_more_results() 檢查多語句查詢內是否還有更多查詢結果
mysqli::multi_query() mysqli_multi_query() 在數據庫內執行多語句查詢
mysqli::next_result() mysqli_next_result() 從 multi_query 中准備下一個結果集
mysqli::options() mysqli_options() 設置選項
mysqli::ping() mysqli_ping() Ping 服務器鏈接,如果鏈接已經斷開,嘗試重連
mysqli::prepare() mysqli_prepare() 准備(prepare)需要執行的 SQL 語句
mysqli::query() mysqli_query() 在數據庫內執行查詢
mysqli::real_connect() mysqli_real_connect() 打開一個 MySQL 服務端的連接
mysqli::real_escape_string(),mysqli::escape_string() mysqli_real_escape_string() 轉義特殊字符,用於 SQL 語句,該轉換會考慮連接中當前的字符集
mysqli::real_query() mysqli_real_query() 執行 SQL 查詢
mysqli::refresh() mysqli_refresh() 刷新表或緩存,或重置復制(replication)服務器信息
mysqli::rollback() mysqli_rollback() 回滾當前事務
mysqli::select_db() mysqli_select_db() 為數據庫查詢設置默認數據庫
mysqli::set_charset() mysqli_set_charset() 設置默認的客戶端字符集
mysqli::set_local_infile_default() mysqli_set_local_infile_default() 清除用戶設置的 load data local infile 命令的處理程序
mysqli::set_local_infile_handler() mysqli_set_local_infile_handler() 設置 LOAD DATA LOCAL INFILE 命令執行的回調函數
mysqli::ssl_set() mysqli_ssl_set() 使用 SSL 建立安全連接
mysqli::stat() mysqli_stat() 獲取當前系統狀態
mysqli::stmt_init() mysqli_stmt_init() 初始化語句並且返回供 mysqli_stmt_prepare 使用的對象
mysqli::store_result() mysqli_store_result() 傳輸最后一個查詢的結果集
mysqli::thread_id() mysqli_thread_id() 返回當前連接的線程ID
mysqli::thread_safe() mysqli_thread_safe() 返回是否設定了線程安全
mysqli::use_result() mysqli_use_result() 初始化一個結果集的取回


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM