title: multiple column update with the value of other column
body: <p>i have two tables</p>
  
  <p>fw_invitations</p>
  
  <pre><code>id    moduleid   qdetailid
  1       1          10  
  2       2          11
  3       3          12
  4       7          13
  5       8          14
  </code></pre>
  
  <p>fw_ind_details</p>
  
  <pre><code>id    moduleid   officeid
   10       0         100 
   11       0         110
   12       0         120
   13       0         130
   14       0         104
  </code></pre>
  
  <p>the column qdetaild is the primary key in <code>fw_ind_details</code>.what i want to do is  want to take the <code>moduleid</code> from <code>fw_invitations</code> table for that particular <code>qdetailid</code> and want to <strong>update</strong> in <code>fw_ind_details</code>.that is it should be done with an update query.</p>
  
  <p><strong>desired output</strong></p>
  
  <p>fw_ind_details</p>
  
  <pre><code>   id    moduleid   officeid
     10       1         100 
     11       2         110
     12       3         120
     13       7         130
     14       8         104
  </code></pre>
  
  <p>this is what i tried so far;</p>
  
  <pre><code>UPDATE `fw_ind_details` 
  SET `moduleid`=(select moduleid 
                 from fw_invitaions fo,fw_ind_details fi
                 where f0.qdetailid=fi.id
                               )
  </code></pre>
  
  <p>i know my approach is wrong,any suggestion will be appreciated.</p>
  
  <p>I am open for the use of PHP.</p>