title: Automatically show database value after select an option
body: <p>Let say i have SQLite's database like this:</p>
  
  <pre><code>+----+-----------+-------+
  | id | name      | price |
  +----+-----------+-------+
  | C1 | Car       | 50000 |
  | B1 | Bike      | 1500  |
  | M1 | Motorbike | 15000 |
  | T1 | Truck     | 99000 |
  +----+-----------+-------+
  </code></pre>
  
  <p>Then to show the database to the select form i use this code:</p>
  
  <pre><code>&lt;form method="post" action="action.php"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;Vehicle&lt;/td&gt;
              &lt;td&gt;:&lt;/td&gt;
              &lt;td&gt;                            
                  &lt;select name='id_vh' onchange='OnChange(this.value)' required&gt;
                  &lt;option selected value=''&gt;choose&lt;/option&gt;
                      &lt;?php               
                          $sql="SELECT * FROM vehicle ORDER BY name ASC";
                          $result=$db-&gt;query($sql);
                          $row=$result-&gt;fetchall(PDO::FETCH_ASSOC);
                          foreach($row as $dt){
                          echo "&lt;option value='$dt[id]'&gt;$dt[name]&lt;/option&gt;";}
                      ?&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  </code></pre>
  
  <p>How to show the price automatically after choose the option, i use the code like this but doesn't work:</p>
  
  <pre><code>&lt;tr&gt;
              &lt;td&gt;Price&lt;/td&gt;
              &lt;td&gt;:&lt;/td&gt;
              &lt;?php
              if(isset($_POST['id_vh'])){
                  $idv=$_POST['id_vh'];
                  $query=$db-&gt;prepare("SELECT * FROM price WHERE id = '$idv'");
                  $query-&gt;execute();
                  $result    =   $query-&gt;fetch(PDO::FETCH_ASSOC);
                  echo"&lt;td&gt;$result[price]&lt;/td&gt;";
              }
              ?&gt;
           &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>