*

stephen cole

  • *
  • 4 posts
can not connect database.
« on: July 18, 2023, 08:15:14 PM »
Hi, my first attempt of downloading and connecting went very well except there was some disruption to my connection and I think it corrupted some files and certain things I could not do. So, I removed everything and downloaded again and used the Install Assistant but it did not work. I have tried  many times including making the config.php files myself. Hopefully someone can put me right.
I am trying to make the instalation here.  didcot-voice.uk/index.php
I will attach my config file attempts and the process and error file.
1st try <?php
  $host_name = 'db5013777215.hosting-data.io';
  $database = 'dbs11531733';
  $user_name = 'dbu2414506';
  $password = '********';

  $link = new mysqli($host_name, $user_name, $password, $database);

  if ($link->connect_error) {
    die('<p>Failed to connect to MySQL: '. $link->connect_error .'</p>');
  } else {
    echo '<p>Connection to MySQL server successfully established.</p>';
  }
?>
2nd try <?php
// MySql database host
define('DB_HOST', 'db5013777215.hosting-data.io');

// MySql database username
define('DB_USER', 'dbu2414506');

// MySql database password
define('DB_PASSWORD', '*******');

// MySql database name
define('DB_NAME', 'classified');

// MySql database table prefix
define('DB_TABLE_PREFIX', 'oc_');

// Relative web url
define('REL_WEB_URL', 'my website');

// Web address - modify here for SSL version of site
define('WEB_PATH', 'my website');
?>


Kind Regards
Steve