title: Add an existing user and INSERT it into another table: don't know what is the syntax in PDO
body: <p>This is my code and I am new in programming and this is for our capstone project.</p>
  <p>I want to SELECT an existing user from 'employee' table and INSERT only the primary key of the user into 'departmenthead' table to set him/her as a Department Head.</p>
  <p>My problem is I don't know what is the perfect syntax for it and I tried to run my code there is no error displayed just white page.</p>
  <pre><code>&lt;?php
  session_start();
  error_reporting(0);
  include('include/db.php');
  if(strlen($_SESSION['alogin'])==0){
      header('location:index.php');
  }
  else{
  if(isset($_GET['empid'])){
      $id=$_GET['empid'];
      $query1=$dbh-&gt;prepare('INSERT INTO departmenthead SELECT * FROM employee WHERE emp_id=:empid');
      $query2=$dbh-&gt;prepare('UPDATE FROM employee WHERE emp_id=:empid');
      $dbh-&gt;beginTransaction();
      if ($query1-&gt;execute([':empid' =&gt; $id]) &amp;&amp; $query2-&gt;execute([':empid' =&gt; $id])) {
          $dbh-&gt;commit();
              header(&quot;Location:adddepthead.php&quot;);
          } else {
              $dbh-&gt;rollBack();
          }
  }?&gt;
  </code></pre>