0

I've uploaded the DB to phpmyadmin, and edited the settings in config.php from htdocs, tried changing XAMPP versions and editing the indexes to the db username,pw,db but I get these errors:

Notice: A session had already been started - ignoring session_start() in C:\xampp\htdocs\includes\global.php on line 104 Notice: Undefined index: sql_host in C:\xampp\htdocs\includes\global.php on line 29 Notice: Undefined index: sql_user in C:\xampp\htdocs\includes\global.php on line 29 Notice: Undefined index: sql_pass in C:\xampp\htdocs\includes\global.php on line 29 Notice: Undefined index: db_name in C:\xampp\htdocs\includes\global.php on line 31 Can't select database

This is a new server that I am setting up. How do I fix these errors? I'm using XAMPP 1.8.3-5 VC11

Line 26-31

function db_connection()
{
    global $config,$data_sql;
    $data_sql = mysql_connect($config["sql_host"], $config["sql_user"], $config["sql_pass"]);
    if (!$data_sql) die("Can't connect to MySql");
    mysql_select_db($config["db_name"],$data_sql) or die("Can't select database");
M. Eriksson
  • 13,450
  • 4
  • 29
  • 40
  • you perhaps should add your config &/or global.php – Professor Abronsius Feb 16 '19 at 15:20
  • **Don't** use the **deprecated and insecure** `mysql_*`-functions. They have been deprecated since PHP 5.5 (in 2013) and were completely removed in PHP 7 (in 2015). Use MySQLi or PDO instead. – M. Eriksson Feb 16 '19 at 15:23
  • Avoid using `global` unless absolutely necessary - pass parameters in where possible. – Nigel Ren Feb 16 '19 at 15:26
  • The PHP version I am using is 5.5.15 from what I can see, but the whole website is coded with mysql functions because it is old. I didn't have this problem before when using a different XAMPP version, but I do not recall which version didn't cause problems. Also, this is the global.php config and config.php is included with include_once. – Philippe Feb 16 '19 at 15:30

0 Answers0