問題描述
我正在閱讀這個問題:mysql 擴展是已棄用,將來會被移除:改用 mysqli 或 PDO
這讓我想到我應該從 mysql 更改為 mysqli.這是 CodeIgniter 中的一個字符更改,因此不是很難:)
And it got me thinking that I should make the change from mysql to mysqli. It is a one character change in CodeIgniter so it isn't very hard :)
但是有什么我應該注意的以發現可能發生的錯誤嗎?是否有某些查詢被區別對待?
But is there anything I should look out for to spot any errors that can happen? Are there certain queries that are treated differently?
推薦答案
是否有某些查詢被區別對待?
Are there certain queries that are treated differently?
沒有
MySQL 和 MySQLi 擴展是處理 PHP 和 MySQL 數據庫服務器之間通信的驅動程序";
The MySQL and MySQLi extension are "drivers" that take care of the communication between PHP and the MySQL database server;
他們不會改變 MySQL 服務器理解的 SQL 命令的范圍.
they do not change the range of SQL commands that the MySQL server understands.
因此,只要 DB 抽象層負責將 PHP 函數用于什么目的(并且像 CI 這樣的框架肯定應該這樣做),就沒有什么可擔心的實際查詢.
So as long as the DB abstraction layer takes care of what PHP functions are to use for what purpose for you (and a framework like CI should most certainly do that), there is nothing to worry about in regard to the actual queries.
這篇關于CodeIgniter 從 mysql 切換驅動程序 -->mysqli的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!