title: PHP mySQL xampp fatal error
body: <p>When i run my php file with the following code:</p>
  
  <pre><code>&lt;?php
  
  
  //configurution of server 
  $serve = mysql_connect('localhost', 'root', 'password');
  if (!$serve) { echo 'error' ; }
  $db = mysql_select_db('record', $serve);
  
  
  
  //action to include 
  if($_GET['action'] == 'include') {
  
      $name = $_GET ['name'];
      $lastname = $_GET['lastname'];
  
      $SQL = "insert into user (name, lastname) VALUES ('$name', '$lastname')";
      $re = mysql_query($SQL, $serve);
  }
  
  
  
  //action list 
  if($_GET['action'] == 'userlist') {
      $SQL = "SELECT * FROM user";
      $re = mysql_query($SQL, $serve);
      $num = mysql_num_rows($re);
  
      if($num &gt; 0) {
  
          //view screen
          while ($Line = mysql_fetch_object($re)) {
              echo "&lt;b&gt;Name: &lt;/b&gt; {$Line-&gt;name} &lt;b&gt;&lt;br&gt;&lt;/b&gt; 
                    &lt;b&gt;Lastname: &lt;/b&gt; {$Line-&gt;lastname} &lt;/br&gt;&lt;hr&gt;";
          }
      }
      else {
          echo 'no user recorded';
  
      }
  }
  ?&gt;
  </code></pre>
  
  <p>This error appears: 
  Fatal error: Call to undefined function mysql_connect() in C:\xampp\htdocs\xampp\record\www\connect.php on line 5</p>
  
  <p>I have ran the php file below to check my extension list to see if '[xx] => mysql' is displayed which it isn't. I have added 'extension=php_mysql.dll' to 'php.ini' and restarted apache &amp; mysql but this still isn't working. I have also added 'C:\xampp\php\ext' into the 'path' environmental variable. I have checked the internet but can't seem to find a solution to my problem, can anyone please help me. Thank-you. </p>
  
  <pre><code>&lt;?php // extensions_list.php 
  
  $list = get_loaded_extensions(); 
  $list2 = array_map('strtolower',$list); 
  sort($list2); 
  echo '&lt;pre&gt;'.print_r($list2,true).'&lt;/pre&gt;'; 
  
  ?&gt;
  </code></pre>