日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区

您的位置:首頁技術文章
文章詳情頁

PHP數據庫擴展之MySQL增強版擴展MySQLi

瀏覽:2日期:2022-09-15 16:29:29

mysqli擴展允許我們訪問MySQL 4.1及以上版本提供的功能。?

mysqli擴展和持久化連接

mysqli擴展的持久化連接在PHP5.3中被引入。支持已經存在于PDO MYSQL 和ext/mysql中。持久化連接背后的思想是客戶端進程和數據庫之間的連接可以通過一個客戶端進程來保持重用, 而不是多次的創建和銷毀。這降低了每次需要創建一個新連接的開銷,未使用的連接被緩存起來并且準備隨時被重用。

不像mysql擴展,mysqli沒有提供一個特殊的方法用于打開持久化連接。需要打開一個持久化連接時,你必須在 連接時在主機名前增加p:。

使用持久化連接的問題在于它們可能在客戶端處于不可預知的狀態。比如,一個表鎖可能在客戶端意外終止之前被激活。 一個新的客戶端進程重用這個持久化連接就會'按照原樣'得到這個連接。這樣,一個新的客戶端進程 為了更好的使用持久化連接,就需要做任何可能的清理工作,這樣就增加了對程序員的負擔。

mysqli擴展的持久化連接提供了內建的清理處理代碼。mysqli?所做的清理工作包括:

回滾活動的事務關閉并且刪除臨時表對表解鎖、重置會話變量關閉prepared語句(在PHP中經常發生)關閉處理程序釋放通過?GET_LOCK()獲得的鎖

這確保了從連接池返回的持久化連接在客戶端進程使用它之前處于干凈的狀態。

mysqli擴展通過自動的調用C-API函數mysql_change_user()?來完成這個清理工作。

自動清理的特性有優點也有缺點。優點是程序員不再需要擔心附加的清理代碼,因為它們會自動調用。然而缺點就是 代碼可能會潛在的慢一點,因為每次從連接池返回一個連接都需要執行這些清理代碼。

這個自動清理的代碼可以通過在編譯php時定義MYSQLI_NO_CHANGE_USER_ON_PCONNECT?來關閉。

mysqli擴展在使用Mysql Native Driver或Mysql Client Library(libmysql)時都支持持久化連接。

MySQLi類

代表PHP和Mysql數據庫之間的一個連接。

mysqli::$affected_rows?— Gets the number of affected rows in a previous MySQL operationmysqli::autocommit?— 打開或關閉本次數據庫連接的自動命令提交事務模式mysqli::begin_transaction?— Starts a transactionmysqli::change_user?— Changes the user of the specified database connectionmysqli::character_set_name?— 返回當前數據庫連接的默認字符編碼mysqli::$client_info?— Get MySQL client infomysqli::$client_version?— Returns the MySQL client version as a stringmysqli::close?— 關閉先前打開的數據庫連接mysqli::commit?— 提交一個事務mysqli::$connect_errno?— Returns the error code from last connect callmysqli::$connect_error?— Returns a string description of the last connect errormysqli::__construct?— Open a new connection to the MySQL servermysqli::debug?— Performs debugging operationsmysqli::dump_debug_info?— 將調試信息輸出到日志mysqli::errno?— 返回最近函數調用的錯誤代碼mysqli::$error_list?— Returns a list of errors from the last command executedmysqli::$error?— Returns a string description of the last errormysqli::$field_count?— Returns the number of columns for the most recent querymysqli::get_charset?— Returns a character set objectmysqli::get_client_info?— Get MySQL client infomysqli_get_client_stats?— Returns client per-process statisticsmysqli_get_client_version?— Returns the MySQL client version as an integermysqli::get_connection_stats?— Returns statistics about the client connectionmysqli::$host_info?— Returns a string representing the type of connection usedmysqli::$protocol_version?— Returns the version of the MySQL protocol usedmysqli::$server_info?— Returns the version of the MySQL servermysqli::$server_version?— Returns the version of the MySQL server as an integermysqli::get_warnings?— Get result of SHOW WARNINGSmysqli::$info?— Retrieves information about the most recently executed querymysqli::init?— Initializes MySQLi and returns a resource for use with mysqli_real_connect()mysqli::$insert_id?— Returns the auto generated id used in the last querymysqli::kill?— Asks the server to kill a MySQL threadmysqli::more_results?— Check if there are any more query results from a multi querymysqli::multi_query?— Performs a query on the databasemysqli::next_result?— Prepare next result from multi_querymysqli::options?— Set optionsmysqli::ping?— Pings a server connection, or tries to reconnect if the connection has gone downmysqli::poll?— Poll connectionsmysqli::prepare?— Prepare an SQL statement for executionmysqli::query?— 對數據庫執行一次查詢mysqli::real_connect?— Opens a connection to a mysql servermysqli::real_escape_string?— Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connectionmysqli::real_query?— 執行一個mysql查詢mysqli::reap_async_query?— Get result from async querymysqli::refresh?— Refreshesmysqli::release_savepoint?— Rolls back a transaction to the named savepointmysqli::rollback?— 回退當前事務mysqli::rpl_query_type?— Returns RPL query typemysqli::savepoint?— Set a named transaction savepointmysqli::select_db?— 選擇用于數據庫查詢的默認數據庫mysqli::send_query?— 發送請求并返回結果mysqli::set_charset?— 設置默認字符編碼mysqli::set_local_infile_default?— Unsets user defined handler for load local infile commandmysqli::set_local_infile_handler?— Set callback function for LOAD DATA LOCAL INFILE commandmysqli::$sqlstate?— Returns the SQLSTATE error from previous MySQL operationmysqli::ssl_set?— Used for establishing secure connections using SSLmysqli::stat?— Gets the current system statusmysqli::stmt_init?— 初始化一條語句并返回一個用于mysqli_stmt_prepare(調用)的對象mysqli::store_result?— Transfers a result set from the last querymysqli::$thread_id?— Returns the thread ID for the current connectionmysqli::thread_safe?— 返回是否是線程安全的mysqli::use_result?— Initiate a result set retrievalmysqli::$warning_count?— Returns the number of warnings from the last query for the given linkMySQLi_STMT類

代表一個prepared語句。

mysqli_stmt::$affected_rows?— Returns the total number of rows changed, deleted, or inserted by the last executed statementmysqli_stmt::attr_get?— Used to get the current value of a statement attributemysqli_stmt::attr_set?— Used to modify the behavior of a prepared statementmysqli_stmt::bind_param?— Binds variables to a prepared statement as parametersmysqli_stmt::bind_result?— Binds variables to a prepared statement for result storagemysqli_stmt::close?— Closes a prepared statementmysqli_stmt::data_seek?— Seeks to an arbitrary row in statement result setmysqli_stmt::$errno?— Returns the error code for the most recent statement callmysqli_stmt::$error_list?— Returns a list of errors from the last statement executedmysqli_stmt::$error?— Returns a string description for last statement errormysqli_stmt::execute?— Executes a prepared Querymysqli_stmt::fetch?— Fetch results from a prepared statement into the bound variablesmysqli_stmt::$field_count?— Returns the number of field in the given statementmysqli_stmt::free_result?— Frees stored result memory for the given statement handlemysqli_stmt::get_result?— Gets a result set from a prepared statementmysqli_stmt::get_warnings?— Get result of SHOW WARNINGSmysqli_stmt::$insert_id?— Get the ID generated from the previous INSERT operationmysqli_stmt::more_results?— Check if there are more query results from a multiple querymysqli_stmt::next_result?— Reads the next result from a multiple querymysqli_stmt::$num_rows?— Return the number of rows in statements result setmysqli_stmt::$param_count?— Returns the number of parameter for the given statementmysqli_stmt::prepare?— Prepare an SQL statement for executionmysqli_stmt::reset?— Resets a prepared statementmysqli_stmt::result_metadata?— Returns result set metadata from a prepared statementmysqli_stmt::send_long_data?— Send data in blocksmysqli_stmt::$sqlstate?— Returns SQLSTATE error from previous statement operationmysqli_stmt::store_result?— Transfers a result set from a prepared statementmysqli_result類

代表從一個數據庫查詢中獲取的結果集

mysqli_result::$current_field?— Get current field offset of a result pointermysqli_result::data_seek?— Adjusts the result pointer to an arbitrary row in the resultmysqli_result::fetch_all?— Fetches all result rows as an associative array, a numeric array, or bothmysqli_result::fetch_array?— Fetch a result row as an associative, a numeric array, or bothmysqli_result::fetch_assoc?— Fetch a result row as an associative arraymysqli_result::fetch_field_direct?— Fetch meta-data for a single fieldmysqli_result::fetch_field?— Returns the next field in the result setmysqli_result::fetch_fields?— Returns an array of objects representing the fields in a result setmysqli_result::fetch_object?— Returns the current row of a result set as an objectmysqli_result::fetch_row?— Get a result row as an enumerated arraymysqli_result::$field_count?— Get the number of fields in a resultmysqli_result::field_seek?— Set result pointer to a specified field offsetmysqli_result::free?— Frees the memory associated with a resultmysqli_result::$lengths?— Returns the lengths of the columns of the current row in the result setmysqli_result::$num_rows?— Gets the number of rows in a resultMySQLi_Driver類

MySQLi 驅動.

client_info客戶端API頭版本(比如:(string)'5.1.49')

client_version客戶端版本(比如:(int)50149)

driver_versionMysqli驅動版本(比如:(int)101009)

embedded是否開啟了MySQLi嵌入式支持。

reconnect允許或阻止重連接(查看INI指令中的mysqli.reconnect)

report_mode設置為MYSQLI_REPORT_OFF,?MYSQLI_REPORT_ALL或者?MYSQLI_REPORT_STRICT?(為錯誤拋出異常,譯注:需要和MYSQLI_REPORT_ERROR聯合使用),?MYSQLI_REPORT_ERROR?(報告MYSQL錯誤)和?MYSQLI_REPORT_INDEX?(報告索引相關的錯誤)的任意組合。

mysqli_driver::embedded_server_end?— Stop embedded servermysqli_driver::embedded_server_start?— Initialize and start embedded servermysqli_driver::$report_mode?— Enables or disables internal report functionsMySQLi_Warning類

代表一個Mysql警告。

message消息字符串

sqlstateSQL狀態

errno錯誤編號

mysqli_warning::__construct?— The __construct purposemysqli_warning::next?— The next purposemysqli_sql_exception類

mysqli異常處理類

mysqli_sql_exception extends RuntimeException { /* 屬性 */ protected string $sqlstate ; /* 繼承的屬性 */ protected string $message ; protected int $code ; protected string $file ; protected int $line ;}別名和過時的Mysqli 函數mysqli_bind_param?— mysqli_stmt_bind_param的別名mysqli_bind_result?— mysqli_stmt_bind_result的別名mysqli_client_encoding?— mysqli_character_set_name的別名mysqli_connect?— 別名 mysqli::__constructmysqli::disable_reads_from_master?— Disable reads from mastermysqli_disable_rpl_parse?— 禁用RPL解析mysqli_enable_reads_from_master?— 開啟從主機讀取mysqli_enable_rpl_parse?— 開啟RPL解析mysqli_escape_string?— 別名 mysqli_real_escape_stringmysqli_execute?— mysqli_stmt_execute的別名mysqli_fetch?— mysqli_stmt_fetch的別名。mysqli_get_cache_stats?— 返回客戶端Zval緩存統計信息mysqli_get_metadata?— mysqli_stmt_result_metadata的別名mysqli_master_query?— 在主/從機制中強制在主機中執行一個查詢mysqli_param_count?— mysqli_stmt_param_count的別名mysqli_report?— 開啟或禁用(Mysql)內部(錯誤)報告函數mysqli_rpl_parse_enabled?— 檢查是否開啟了RPL解析mysqli_rpl_probe?— RPL探測mysqli_send_long_data?— mysqli_stmt_send_long_data的別名mysqli_set_opt?— mysqli_options的別名mysqli_slave_query?— 在主/從機制中強制在從機上執行一個查詢

標簽: PHP
相關文章:
日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区
激情久久婷婷| 国产精品sss在线观看av| 国产精品久久久久av蜜臀| 亚洲在线一区| 婷婷成人在线| 国产精品黄色| 婷婷综合激情| 久久国产欧美| 精品久久美女| 久久午夜影院| 精品视频一区二区三区四区五区| 三级久久三级久久久| 一区二区三区四区精品视频| 国产亚洲欧洲| 少妇精品久久久| 亚洲天堂日韩在线| 亚洲激情五月| 亚洲视频二区| 亚洲我射av| 国产欧美日韩综合一区在线播放| 蜜臀av在线播放一区二区三区| sm捆绑调教国产免费网站在线观看| 成人在线超碰| 国产一区二区三区久久| 精品亚洲免a| 欧美色图国产精品| 不卡在线一区二区| 中文一区二区| 青青草91视频| 欧美日韩一区二区三区四区在线观看 | 久久精品99久久久| 日韩精品免费一区二区夜夜嗨 | 国产午夜久久av| 国产福利91精品一区二区| 日韩在线不卡| 99久久夜色精品国产亚洲狼| a日韩av网址| 欧美午夜不卡| 国产偷自视频区视频一区二区| 亚洲在线免费| 日韩一区二区三区四区五区| 国产美女精品| 国产亚洲欧美日韩精品一区二区三区 | 免费一区二区三区在线视频| 日韩免费视频| 国产在线不卡| 久久九九精品| 亚洲综合色婷婷在线观看| 欧美日韩一区二区高清| 免费看黄色91| 亚洲ab电影| 欧美a级一区二区| 91中文字幕精品永久在线| 国产精品专区免费| 韩日一区二区三区| 久久精品97| 国产一区一一区高清不卡| 成人日韩在线观看| 日韩不卡手机在线v区| 国产成人精品三级高清久久91| 亚洲一区二区三区高清不卡| 日本h片久久| 激情婷婷综合| 日韩成人av影视| 久久一区二区三区电影| 日韩精品视频在线看| 在线日韩中文| 亚洲一区导航| 成人午夜毛片| 91亚洲无吗| 91精品精品| 日韩av一区二区三区四区| 高清不卡一区| 伊人国产精品| 欧洲精品一区二区三区| 国产精品综合| 欧美色图国产精品| 日韩一区二区三区四区五区| 久久精品国产亚洲夜色av网站| 蜜桃免费网站一区二区三区| 精品国产免费人成网站| 日韩欧美高清一区二区三区| 成人日韩av| 日韩啪啪电影网| 久久精品xxxxx| 亚洲高清激情| 久久久男人天堂| 亚洲人成高清| 91精品久久久久久久久久不卡| 国产精品蜜月aⅴ在线| 国产精品av久久久久久麻豆网| 欧美色综合网| 亚洲欧美在线综合| 私拍精品福利视频在线一区| 91p九色成人| 天使萌一区二区三区免费观看| 久久97视频| 亚洲香蕉网站| 国产成人久久精品一区二区三区| 亚洲毛片在线免费| 狠狠操综合网| 中文字幕在线视频网站| 青青草国产成人99久久| 亚洲免费毛片| 91精品99| 风间由美中文字幕在线看视频国产欧美| 久久精品97| 国产一卡不卡| 久久国产婷婷国产香蕉| 99亚洲视频| 国产成人a视频高清在线观看| 国产丝袜一区| 午夜亚洲福利在线老司机| 欧美日韩视频免费观看| 国产精品久久久久久模特| 石原莉奈在线亚洲三区| 日韩视频一区| 精品捆绑调教一区二区三区| 欧美激情aⅴ一区二区三区| 国产精品日韩精品中文字幕| 日韩中文字幕麻豆| 亚洲www免费| 久久九九精品| а√天堂8资源中文在线| 日本一区二区免费高清| 国产精品网站在线看| 日韩欧美中文字幕一区二区三区| 国产亚洲网站| 999久久久精品国产| 吉吉日韩欧美| 色吊丝一区二区| 日韩精品永久网址| 国产麻豆久久| 欧美二三四区| 麻豆mv在线观看| 国产v综合v| 丝袜美腿诱惑一区二区三区 | 国产一区福利| 欧美黄色精品| 日韩中文一区二区| 婷婷成人基地| 欧美手机在线| 蜜桃久久av一区| 亚洲一区二区免费在线观看| 免费视频一区二区| 久久亚洲视频| 男女男精品视频网| 亚洲婷婷丁香| 四虎精品永久免费| 日韩精品欧美成人高清一区二区| 国产精品社区| 三级在线观看一区二区 | 影院欧美亚洲| 99亚洲精品| 不卡在线一区| 日本国产亚洲| 国产精品一区二区三区www | 另类激情亚洲| 综合国产在线| 日韩av不卡在线观看| 精品久久一区| 日韩电影在线视频| 国产综合精品| 日韩激情视频网站| 日本免费在线视频不卡一不卡二| 亚洲+小说+欧美+激情+另类| 亚洲毛片网站| 国产精久久一区二区| 成人精品久久| 最新日韩欧美| 日韩专区视频网站| 97精品国产福利一区二区三区| 亚洲精品在线影院| 国产调教一区二区三区| 久久精品亚洲一区二区| 都市激情国产精品| 一区二区国产在线| 欧美日韩午夜| 给我免费播放日韩视频| 亚洲高清毛片| 视频一区日韩| 日韩欧美不卡| 欧美日韩国产高清电影| 久久精品av| 国产欧美一区二区三区米奇| 精品精品国产三级a∨在线| 欧美资源在线| 91精品国产自产在线丝袜啪| 美女性感视频久久| 国产一级一区二区| 国产伦理一区| 国语精品一区| 热久久久久久久| 国产毛片精品| 午夜在线一区二区| 国产精品密蕾丝视频下载| 特黄特色欧美大片| 国产乱人伦丫前精品视频| 欧美精品高清| 国产精品分类|