为什么一个人不应该使用mysql_*功能的技术原因是什么?(例如mysql_query(),mysql_connect()或mysql_real_escape_string())?
即使他们在我的网站上工作,为什么还要使用其他东西?
如果他们不在我的网站上工作,为什么我会收到错误
警告:mysql_connect():没有这样的文件或目录
根据下面的代码,我用于常规的mysql,我怎么能将它转换为使用mysqli?
是否像更改**mysql _query($ sql)一样简单 ; 到mysqli _query($ sql) ; ?**
<?PHP
//in my header file that is included on every page I have this
$DB["dbName"] = "emails";
$DB["host"] = "localhost";
$DB["user"] = "root";
$DB["pass"] = "";
$link = mysql_connect($DB['host'], $DB['user'], $DB['pass']) or die("<center>An Internal Error has Occured. Please report following error to the webmaster.<br><br>".mysql_error()."'</center>");
mysql_select_db($DB['dbName']);
// end header connection part
// function from a functions file that I run a mysql query through in any page.
function executeQuery($sql) { …Run Code Online (Sandbox Code Playgroud)