title: combine two "unrelated" fields in form
body: <p>I am just learning PHP and MySql, and learning it by creating my own simple BLOG with CMS. I am running into a problem here though.</p>
  
  <p>I have a page called <code>edit_cat.php</code>. This is for editing the category created earlier.</p>
  
  <p>My DB table looks likes this:</p>
  
  <pre><code> cat_id   |   cat_title   |   parent_id
   --------------------------------------
   1           Comedy               0
   2           Standup              1
   3           Music                0
   4           Film music           3
  </code></pre>
  
  <p>When editing the post I want the user (<em>which will be me</em>), to be able to select a different parent category. </p>
  
  <pre><code>&lt;?php
  
    $cat_id=$_GET['id'];
  
    $result = $db-&gt;prepare("SELECT * FROM categories WHERE cat_id=:cat_id");      
    $result-&gt;bindParam(':cat_id', $cat_id);
    $result-&gt;execute();
    $row = $result-&gt;fetch(PDO::FETCH_ASSOC);
  
  ?&gt;
  
  &lt;div class="col-md-8"&gt;
  
    &lt;h2&gt;Edit Category&lt;/h2&gt;
  
    &lt;?php 
      if(isset($succes_update)){
        echo $succes_update; 
      }
    ?&gt;
  
    &lt;form class="form-inline" action="" method="POST"&gt;
  
      &lt;input type="hidden" class="form-control" name="cat_id" value="&lt;?php echo     $cat_id; ?&gt;"&gt;
  
      Category Title&lt;br&gt;
      &lt;input type="text" class="form-control" name="cat_title" value="&lt;?php echo $row['cat_title']; ?&gt;"&gt;&lt;br&gt;
  
      Category sub Title&lt;br&gt;
      &lt;textarea class="form-control" name="sub_cat_title"&gt;&lt;?php echo $row['sub_cat_title']; ?&gt;&lt;/textarea&gt;&lt;br&gt;
  
      Parent Category&lt;br&gt;
      &lt;select name="parent_id"&gt;
        &lt;option selected&gt;&lt;?php echo $row['parent_id'];?&gt;&lt;/option&gt;
        &lt;?php
          $result = $db-&gt;prepare("SELECT DISTINCT parent_id FROM categories");
          $result-&gt;execute();
          for($i=0; $row = $result-&gt;fetch(); $i++){   
            echo "&lt;option&gt;" . $row['parent_id'] . "&lt;/option&gt;"; 
          }
        ?&gt;
      &lt;/select&gt;
  
      &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
  
      &lt;input type="submit" value="Save" class="btn btn-primary"/&gt;
    &lt;/form&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>On this piece:</p>
  
  <pre><code>echo "&lt;option&gt;" . $row['parent_id'] . "&lt;/option&gt;"; 
  </code></pre>
  
  <p>I want the the <code>parent_id</code>, but also the <code>cat_title</code> related to the <code>parent_id</code> to be shown. This is so, so that it is easier to work with (<em>title/name works better then a number</em>).</p>
  
  <p>Anyone an idea on how to do this?</p>