title: PHP Fatal error: Call to undefined function mssql_query()
body: <p>So I keep getting this error when I want to query something to the ms sql server..</p>
  
  <p>The connection is made with the database but the queries seem to fail. </p>
  
  <p>The error log contains this:</p>
  
  <pre><code>    PHP Fatal error:  Call to undefined function mssql_query()
  </code></pre>
  
  <p>The code on the php:</p>
  
  <pre><code>session_start();
  include_once("connect.php");
  if (isset($_POST['username'])) {
  $username = $_POST['username'];
  $password = $_POST['password'];
  $sql = "SELECT * FROM test WHERE username='".$username."' AND password='".$password."'";
  $res = mssql_query ($sql) or die(mssql_error());
  
  if (mssql_num_rows($res) == 1) {
      $row = mssql_fetch_assoc($res);
      $_SESSION['uid'] = $row['id'];
      $_SESSION['username'] = $row['Username'];
      $_SESSION['afdeling'] = $row['Afdeling'];
      $_SESSION['mail'] = $row['Mail'];
                header("Location: test.php");
      exit();
  } else {
      echo "Invalid login information. Please return to the previous page.";
      exit(); }  }  ?&gt;
  </code></pre>
  
  <p>Does anybody knows what the problem is?</p>
  
  <p>Thanks in advance!</p>
  
  <p>connect.php code:</p>
  
  <pre><code>&lt;?php
  $serverName = "MTN-TEST"; //serverName\instanceName
  $connectionInfo = array( "Database"=&gt;"PROCES_TEST", "UID"=&gt;"blaaa", "PWD"=&gt;"blooo");
  $conn = sqlsrv_connect( $serverName, $connectionInfo);
  
  if( $conn ) {
       echo "&lt;span style='color:green;'&gt;Connection established.&lt;/span&gt;&lt;br /&gt;";
  }else{
       echo "&lt;span style='color:red;'&gt;Connection could not be established.&lt;/span&gt;&lt;br /&gt;";
      die( print_r( sqlsrv_errors(), true));
  }
  ?&gt;
  </code></pre>