This question already has an answer here:
Th problem: it says
Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Applications/XAMPP/xamppfiles/htdocs/...
I think I have change mysql to mysql but how?
<?php
$database="sphider_db";
$mysql_user = "root";
$mysql_password = "";
$mysql_host = "localhost";
$mysql_table_prefix = "";
$success = mysql_pconnect ($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();
}
?>
Use
MySQLi-connect
insted ofMySQL_connect
as well as instead of
mysql_select_db
usemysqli_select_db
EDIT 01
in
mysqli_connect
you can select database tooYou have to stop using
mysql_*
functions. These extensions have been removed in PHP 7. Learn about prepared statements for PDO and MySQLi and consider using PDO, it's really pretty easy.