title: Trying to connect with PHP to remote SQL Server. Error "No connection could be made"
body: <p>I am trying to to insert data from PHP form to a remote SQL Server database.</p>
  
  <p>When I clicked on a button submit get an error: </p>
  
  <blockquote>
    <p><em>Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in C:\wamp64\www\connection\connection.php on line 30</em></p>
    
    <p>And an error: <em>Connection could not be established. Array ( [0] =>
    Array ( [0] => 01000 [SQLSTATE] => 01000 [1] => 5701 [code] => 5701
    [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Changed
    database context to 'Workflow'. [message] => [Microsoft][ODBC Driver
    13 for SQL Server][SQL Server]Changed database context to 'Workflow'.
    ) [1] => Array ( [0] => 01000 [SQLSTATE] => 01000 [1] => 5703 [code]
    => 5703 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Changed language setting to us_english. [message] =>
    [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Changed language
    setting to us_english. ) )</em></p>
  </blockquote>
  
  <p>I have installed ODBC driver.</p>
  
  <p>Connection.php:</p>
  
  <pre><code>&lt;?php   
  $servername = "server_ip"; 
  $connectionInfo=array( "Database"=&gt;"Workflow", "UID"=&gt;"admin", 
  "PWD"=&gt;"pass");
  $conn=sqlsrv_connect($servername, $connectionInfo);
  
   $ID = $_POST['id'];
   $Date = $_POST['date'];
  
  
          $sql = "INSERT INTO T1 (ID,Date) VALUES ('$ID','$Date')";
  
   if(mysqli_query($conn,$sql)) {
      echo "Connection established.&lt;br /&gt;";
      }else{
      echo "Connection could not be established.&lt;br/&gt;";
      die(print_r(sqlsrv_errors(), true));
      }
  
  
  if(!mysqli_query($conn,$sql)) {
  echo 'Data not inserted';
  } else {
  echo 'Data inserted';
  }
  
  ?&gt;
  </code></pre>
  
  <p>Index.html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;    
          &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
          &lt;title&gt;Form&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form action="connection.php" method="post"&gt;
              &lt;div class="container"&gt;
              ID: &lt;input type="text" name="id"&gt;
                          Date: &lt;input type="text" name="date"&gt;
              &lt;/div&gt;
              &lt;input type="submit" value="insert"&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>