Deprecated: mysql_connect()
There are a few solutions to your problem.
The way with MySQLi would be like this:
<?php
$connection = mysqli_connect('localhost', 'username', 'password', 'database');
To run database queries is also simple and nearly identical with the old way:
<?php
// Old way
mysql_query('CREATE TEMPORARY TABLE `table`', $connection);
// New way
mysqli_query($connection, 'CREATE TEMPORARY TABLE `table`');
Turn off all deprecated warnings including them from mysql_*:
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
The Exact file and line location which needs to be replaced is "/System/Startup.php > line: 2 " error_reporting(E_All); replace with error_reporting(E_ALL ^ E_DEPRECATED);
How to hide Deprecated: mysql_connect() warning?
For your own safety: Just don't use mysql_connect
!
Switch to mysqli or pdo.
Anyway to hide/suppress deprecated warnings you may do:
error_reporting(E_ALL ^ E_DEPRECATED);
or to suppress all errors/warnings:
error_reporting(0);
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
<?php
$con = mysqli_connect("localhost","root","","register");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>
// try this..
Related Topics
Sending Email With Gmail Smtp With Codeigniter Email Library
Property [Title] Does Not Exist on This Collection Instance
Force Ssl/Https Using .Htaccess and Mod_Rewrite
Increasing the Maximum Post Size
How to Connect to Multiple MySQL Databases on a Single Webpage
Why Can't I Access Datetime-≫Date in PHP'S Datetime Class
Mvc For Advanced PHP Developers
How to Sort Files by Date in PHP
Difference Between Http_Host and Server_Name in PHP
How to Get a Substring Between Two Strings in PHP
How to Get a File Name from a Full Path With PHP
PHP 7.2 Function Create_Function() Is Deprecated
Preferred Method to Store PHP Arrays (Json_Encode VS Serialize)
PHP Elvis Operator VS Null Coalescing Operator
Recursive Function to Generate Multidimensional Array from Database Result