The MySQL extension is deprecated and'll be removed in the future what's the reason AH solution

Source: Internet
Author: User
Tags deprecated
The MySQL extension is deprecated and'll be removed in the future, what's the reason?
I configured on my Computer 2-plan-team this system, which is written in PHP, after configuration, open index.php, but the following problems: Php Deprecated:mysql_connect (): The MySQL extension is Deprecated and would be removed in the Future:use mysqli or PDO instead in E:\SERVER\2-PLAN-TEAM\INCLUDE\CLASS.DATENBANK.P HP on line 38
Source code for class.datenbank.php:

/*
* The class Datenbank (database) provides methods to handle a database connection
*
* @author original code from Open Dynamics.
* @name Datenbank
* @version 0.4.6
* @package 2-plan
* @link http://2-plan.com
* @license http://opensource.org/licenses/gpl-license.php GNU general Public License V3 or later
*/
Class Datenbank
{

/*
* Constructor
*/
function __construct ()
{
}

/*
* Establish a database connection
*
* @param string $db Database name
* @param string $user Database user
* @param string $pass Password for database access
* @param string $host Database Host
* @return BOOL
*/
Function Connect ($db _name, $db _user, $db _pass, $db _host= "localhost")
{

Mysql
$db = new PDO ("mysql:host= $db _host;dbname= $db _name", $db _user, $db _pass);

$conn = mysql_connect ($db _host, $db _user, $db _pass);
$db _check = mysql_select_db ($db _name);
if ($db _check)
{
return true;
}
Else
{
return false;
}
}

/*
* Wrap mysql_query function
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.