title: PHP MYSQL Insert Into one table from another
body: <p>I have tried a bunch of soultions on here an other forums but always get errors.
  Here is current PHP code using hostgator and PHP 5.2</p>
  
  <pre><code>$insert = "INSERT INTO events (datecreated, fullname, email, title, url, picurl, desc, psw, skypeid, event) SELECT jvs.datecreated, jvs.fullname, jvs.email, jvs.title, jvs.url, jvs.picurl, jvs.desc, jvs.psw, jvs.skypeid, jvs.event FROM jvs";
  if (! mysqli_query($dbh, $insert)  ||  mysqli_affected_rows($dbh) == 0)
              {
  die ("&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Failed to insert data- " . mysqli_error($dbh));
              }
  </code></pre>
  
  <p>Error I get is:</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near 'desc, psw, skypeid, event) SELECT jvs.datecreated, jvs.fullname,
    jvs.email, jvs.' at line 1</p>
  </blockquote>
  
  <p>I have checked every field in both tables and the spelling is correct and the fileds are there.
  The fileds are not in the same order in events table and that table has many more fields.
  Thanks,
  Ed</p>