Fatal Erro Database

Asked

Viewed 62 times

0

I was installing a site, after all completed I open the site and I come across this error:

Fatal error: Uncaught Error: Call to Undefined Function mysql_select_db() in /home/imwfzgbi/public_html/config/config.php:19 Stack trace: #0 /home/imwfzgbi/public_html/index.php(15): include() #1 {main} thrown in /home/imwfzgbi/public_html/config/config.php on line 19

Config.php:

<?php
    $siteA = 'http://'.$_SERVER['SERVER_NAME'].'/';
    $siteB = '/';
    $email_suporte_staff = '[email protected]';

    global $siteB;
    global $siteA;

    $config_bd = array(
        'host' => 'localhost',
        'db' => 'imwfzgbi_ultra',
        'usuario' => 'imwfzgbi_flix',
        'senha' => 'ultraflixbr',
    );

    $conect = mysql_connect($config_bd['host'], $config_bd['usuario'], $config_bd['senha']);
    if($conect)
    {
        mysql_select_db($config_bd['db']);
        mysql_set_charset('utf8');
    }
    else
    {
        echo '<center><b>config/config.php</b> nao configurado.</center>';
        exit;
    }
?>

These are the files with the supposed error. Can anyone help me?

  • What version of PHP are you using?

  • PHP version: 5.6

  • Make sure the mysql_* is entitled to php.ini (utilize phpinfo(); for that reason). Why should we not use mysql type functions_*?

  • cPanel-generated php ini Directives, do not Edit ; Manual Editing of this file may result in Unexpected behavior. ; To make changes to this file, use the cPanel Multiphp INI Editor (Home >> Software >> Multiphp INI Editor) ; For more information, read our Documentation (https://go.cpanel.net/EA4ModifyINI) display_errors = Off max_execution_time = 200 max_input_time = -1&#xA;max_input_vars = 10000&#xA;memory_limit = 1024M&#xA;post_max_size = 128M&#xA;session.gc_maxlifetime = 1440&#xA;session.save_path = "/var/cpanel/php/sessions/ea-php70"&#xA;upload_max_filesize = 128M&#xA;zlib.output_compression = Off

  • this and php.ini

  • mysql driver has been obsolete for a few years. Use Mysqli, or PDO

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.