title: SQL text boxes with dynamic information / auto fill text boxes
body: <p>I am trying to make a webpage that connects to my SQL database and fetches information from a table and place it into a text box. The information it fetches is dependent on what is entered into another text box. Essentially its an "autofill" of information. I was curious whether this was possible.</p>
  
  <p>To create a better understanding here is a layout of text boxes:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;?php
  $con = mssql_connect("abc", "123", "password");
  if (!$con)
    {
    die('Could not connect: ' . mssql_get_last_message());
    }
  
  mssql_select_db("db1", $con);
  
  $result = mssql_query("SELECT * FROM FormData");
  &lt;head&gt;
  
  &lt;title&gt;test&lt;/title&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;h1&gt;test&lt;/h1&gt;
  
      &lt;form action="#"&gt;
  
          &lt;p&gt;Enter ID&lt;/p&gt;
  
          &lt;input type="text" name="ID"/&gt; 
          &lt;input type="text" name="NAME"/&gt; 
          &lt;input type="text" name="LASTNAME"/&gt; 
          &lt;input type ="button" value="submit" onclick="check(ID)" /&gt;
  
  
  
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here an ID would be entered into a text box and then once the submit button was pressed, it would fetch the rest of the information from my sql database into the next boxes. I don't even know whether this is possible, whether I can use Javascript in conjunction with this or something. I searched but couldn't find much help on the subject. </p>
  
  <p>I'm not even sure if its possible to do "if" statements within SQL - whenever I try I end up with a 500 error due to improper syntax.</p>