[英]how do you fix this error mysql
我不知道如何解決這個問題:
編輯:有人可以通過更正來編輯我的代碼,因為這是由於 tmrw.
致命錯誤:未捕獲的錯誤:調用 C:\\xampp\\htdocs\\login\\login-registration-php\\login-registration-php-new\\dbconnect.php:6 堆棧跟蹤:#0 C:\\ 中未定義的函數 mysql_connect() xampp\\htdocs\\login\\login-registration-php\\login-registration-php-new\\index.php(4): require_once() #1 {main} 拋出在 C:\\xampp\\htdocs\\login\\login-registration-第 6 行的 php\\login-registration-php-new\\dbconnect.php
<?php
// this will avoid mysql_connect() deprecation error.
error_reporting( ~E_DEPRECATED & ~E_NOTICE );
// but I strongly suggest you to use PDO or MySQLi.
$conn = mysql_connect(localhost,nathan,password);
$dbcon = mysql_select_db(dbtest);
if ( !$conn ) {
die("Connection failed : " . mysql_error());
}
if ( !$dbcon ) {
die("Database Connection failed : " . mysql_error());
}
請檢查 extension=mysqli.so 和 extension=mysql.so 都在你的 php.ini 中取消注釋。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.