title: Trying to insert data from one table to another in php MYSQL
body: <p>No matter what I do I get a syntax error and I cannot figure out why? </p>
  
  <pre><code>$sn= "INSERT INTO [Drive Errors](Serial Number) SELECT [Serial Number] FROM [Drive List] ORDER BY [Position]ASC";
  odbc_exec($con,$sn);
  </code></pre>
  
  <p>Thanks, the code works but now all the previous data is being deleted when I insert the the serial number data. Any suggestions? </p>
  
  <pre><code>$sn= "INSERT INTO [Drive Errors]([Serial]) SELECT [Serial Number] FROM [Drive List] ORDER BY [Position]ASC";
  odbc_exec($con,$sn);
  
  //Selecting table(de) and row(pos) need it in brackets
  $sql= "SELECT * FROM [Drive Errors] ORDER BY [Position]ASC"; 
  
  $rs=odbc_exec($con,$sql);
  if (!$rs)
  {echo("Error");} 
  </code></pre>