title: how to fetch data from one table and insert into another table in php
body: <pre><code>&lt;?php
      $m        = "arushi";
      $em       = "SELECT emailid FROM tblregister WHERE name='$m'";
      $q        = mysql_query($em);
      $n        = mysql_fetch_assoc($q);
      $fullName = mysql_real_escape_string($_POST['name']);
      $address  = mysql_real_escape_string($_POST['address']);
      $mobNo    = mysql_real_escape_string($_POST['dinner']);
      $summary  = "jsf";
      $sql      = "INSERT INTO tbljcustomer VALUES('$m', '$n', '$fullName',     
      '$address','$mobNo', '$summary')";
  
      if(!(mysql_query($sql)))
      {
          echo "Sorry!!! we were unable to process please try again";
      }
      else
      {
          echo "customized";
      }
  ?&gt;
  </code></pre>
  
  <p>on executing this everything works fine except that it doesn't fetch emailid from tblregister rather it displays just Array or sometimes resource id#10. Thanks in advance</p>