title: How to autofill <input > in depending of <select > from MySQL?
body: <p>I have no experience in PHP, HTML or JavaScript and I ask for help.</p>
  
  <p>I have php code that displays one select, (strings of this select is from MySQL database) and two input fields. 
  MySQL table "g_achievement" format:</p>
  
  <pre><code>id;     achievement;        craft_1_points;     craft_2_points;  
  0;      Medal Gold;         5;                  8;  
  1;      Medal Silver;       10;                 15;  
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/BnyNg.png" alt="select and inputs"></p>
  
  <p>I need to autofill inputs by data from "craft_1_points" and "craft_2_points" when I select in select field.</p>
  
  <p>My code:</p>
  
  <pre><code>echo "&lt;label for=\"achievement_id\"&gt;Achievement&lt;/label&gt;&lt;br/&gt;";
      $sql2 = "SELECT * FROM g_achievement";
      $result_select2 = mysql_query($sql2);
      /*drop-down list*/
      echo "&lt;select name = 'achievement'&gt;";
      while($object2 = mysql_fetch_object($result_select2)){
          echo "&lt;option value = '$object2-&gt;achievement'&gt;$object2-&gt;achievement&lt;/option&gt;";
      }
      echo "&lt;/select&gt;";
  //============================
      echo "&lt;label for=\"craft_1\"&gt;Craft 1&lt;/label&gt;&lt;br/&gt;";
      echo "&lt;input type=\"number\" name=\"craft_1\" size=\"30\"&gt;&lt;br/&gt;";
      echo "&lt;label for=\"craft_2\"&gt;Craft 2&lt;/label&gt;&lt;br/&gt;";
      echo "&lt;input type=\"number\" name=\"craft_2\" size=\"30\"&gt;&lt;br/&gt;";
  </code></pre>
  
  <p>What is language I need to use? JavaScript? What is code I need?</p>
  
  <p>Help me please. Thank you.</p>