-2

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();
    }
?>
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
Pinalla
  • 43
  • 6

2 Answers2

0

You 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.

Community
  • 1
  • 1
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
0

MySQL extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.

Use MySQLi-connect insted of MySQL_connect
as well as instead of mysql_select_db use mysqli_select_db


EDIT 01

in mysqli_connect you can select database too

$link = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db");
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85