AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL

Deprecated: mysql_connect() mysql extension is deprecated and will be removed in the future



I have this error Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in - how to solve it?
My connect.php page is:

Example

<?php

$database="my_database_name";
$mysql_user = "my_mysql_user";
$mysql_password = "1234";
$mysql_host = "localhost";
$mysql_table_prefix = "";

$success = mysql_connect ($mysql_host, $mysql_user, $mysql_password);
if (!$success)
die ("<b>Cannot connect to database, check if username, password and host are correct.</b>");
$success = mysql_select_db ($database);
if (!$success) {
print "<b>Cannot choose database, check if database name is correct.";
die();
}
?>


I have this error deprecated mysql_connect() mysql extension is deprecated how to solve it?



deprecated mysql_connect
Deprecated: mysql_connect() mysql extension is deprecated and will be removed - php mysqli

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


0
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.