title: Connecting to Database In PHP
body: <p>I am currently attempting to migrate my website from MVC asp.net to PHP after experiencing numerous issues with my host provider.  The initial changes have proved easy with PHP being quite simple to get to grips with.  However, I have hit a brick wall for the last few pages that require interaction with an SQL database.</p>
  
  <p>I have worked through a number of different tutorials and helps and each one leads to the sample problem.</p>
  
  <pre><code>function db_connect()
  {
      $conn = mysql_connect ('localhost', 'root', '') or die ('I cannot connect to the database because: ' . mysql_error());
  
      mysql_select_db ('Database');
  
      return $conn;
  }
  </code></pre>
  
  <p>Which returns the error "Call to undefined function mysql_connect()" on the first line.</p>
  
  <p>I have checked the php.ini file and this seems correct</p>
  
  <pre><code>; extension_dir = "./"
  ; On windows:
  extension_dir = "C:\Program Files\Jcx.Software\VS.Php\2013\php 5.4\ext"
  
  extension=php_mysql.dll
  </code></pre>
  
  <p>And the dll is in the corresponding directory.</p>
  
  <p>I think I am probably missing something really obvious, but would appreciate any help someone can give me.</p>