title: Getting the Error 'mssql_query(): supplied argument is not a valid MS SQL-Link resource' when Trying to Add Table Data
body: <p>I'm trying to use PHP to insert a username and password into my MSSQL table. I am unfamiliar with MSSQL, but it is for a client. I am getting the error <code>mssql_query(): supplied argument is not a valid MS SQL-Link resource in</code> when I try to run my PHP page on the website. </p>
  
  <p>Here is my PHP page code: </p>
  
  <pre><code>&lt;?php
  $con=mssql_connect("gbs.com","Gser","Robs1!","GBMser");
  var_dump($con);
  // Check connection
  if (!$con) {('Something went wrong while connecting to MSSQL'); }
  if ($con) {
      echo ("Connection is succeed");
  } else {
      echo ("Connection is fail");
  }
  
  var_dump($con);
  mssql_query($con,"INSERT INTO users (username, password)
  VALUES ('d', md5('d'))");
  
  if (!mssql_query) {
      // The query has failed, print a nice error message
      // using mssql_get_last_message()
      die('MSSQL error: ' . mssql_get_last_message());
  }
  
  mssql_close($con);
  ?&gt;
  </code></pre>
  
  <p>Here is what my PHP page displays when I run the code:</p>
  
  <pre><code>resource(1) of type (mssql link) Connection is succeedresource(1) of type (mssql link) 
  Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in D:\Hosting\4502990\html\insertadminaccount.php on line 14
  </code></pre>
  
  <p>Any help is appreciated. Thank you, everyone.</p>