title: Running SQL Query in PHP File
body: <p>I have established a connection with my SQL Database through Windows Authentication in my php file.  However I'm not sure how the syntax will look if I wanted to display a simple SQL query such as (Select * from Media) on the php page that shows an entire table.  I tried a few methods but it displayed a fatal error.</p>
  
  <p>Here is my code for the php:</p>
  
  <pre><code>     &lt;?php
  
       $serverName = "172.20.90.170,5050"; //serverName\instanceName
  
       // Since UID and PWD are not specified in the $connectionInfo array,
       // The connection will be attempted using Windows Authentication.
       $connectionInfo = array( "Database"=&gt;"TestDB");
       $conn = sqlsrv_connect( $serverName, $connectionInfo);
  
       if( $conn ) {
       echo "Connection established.&lt;br /&gt;";
       }else{
       echo "Connection could not be established.&lt;br /&gt;";
       die( print_r( sqlsrv_errors(), true));
       }
       $version = mssql_query('SELECT * FROM MEDIA');
       $row = mssql_fetch_array($version);
       echo $row[0];
  
       ?&gt; 
  </code></pre>
  
  <p>Fatal Error:</p>
  
  <pre><code>  Fatal error: Call to undefined function mssql_query()
  </code></pre>
  
  <p>This establishes a succesful connection but what would I need to change in my code for this query to run error free and display the required output?</p>