title: Connecting to database via php
body: <p>I've simply trying to connect to the database but unfortunately it doesn't do it at all. I've got scripts at the bottom that it's pointing to first so just wondering if there's anything a bit strange.</p>
  
  <p>I done some research and found out that the php method I've written is a bit old and considering I used the same last year and it worked.</p>
  
  <p>Anything that makes it obvious it doesn't connect let me know.</p>
  
  <p>Thanks.</p>
  
  <p>connect.php:</p>
  
  <pre><code>&lt;?php
  $connect_error = 'Sorry, we\'re experiencing connection problems.';
  mysql_connect('localhost', 'devdegre_ddevlin', 'password123') or die($connect_error);
  mysql_select_db('devdegre_logreg') or die($connect_error);
  ?&gt;
  </code></pre>
  
  <p>init.php:</p>
  
  <pre><code>&lt;?php
  session_start();
  //error_reporting(0);
  
  require 'database/connect.php';
  require 'functions/general.php';
  require 'functions/users.php';
  
  $current_file = explode('/', $_SERVER['SCRIPT_NAME']);
  $current_file = end($current_file);
  
  if (logged_in() === true) {
  $session_user_id = $_SESSION['user_id'];
  $user_data = user_data($session_user_id, 'user_id', 'username', 'password',  
          'first_name', 'last_name', 'email', 'password_recover', 'type',
  
  'allow_email', 'profile');
  if (user_active($user_data['username']) === false) {
      session_destroy();
      header('Location: index.php');
      exit();
  }
  if ($current_file !== 'changepassword.php' &amp;&amp; $user_data['password_recover'] == 1) {
      header('Location: changepassword.php?force');
      exit();
  }
  }
  
  $errors = array();
  ?&gt;
  </code></pre>
  
  <p>I've dumped sql to create a user database and entered a user. It always goes to the connect.php so I can't work it out I've tried various ways to connect with username, password etc.</p>