title: PHP Insert data from one table to another
body: <p>I was trying to insert the data from one table to another, and this is the error message I get:</p>
  <blockquote>
  <p>Error: INSERT INTO content2 (d1, d2, d3) VALUES (John, Doo, 24);</p>
  <p>Unknown column 'John' in 'field list'Error: INSERT INTO content2 (d1,
  d2, d3) VALUES (Mary, Moe, 36);</p>
  <p>Unknown column 'Mary' in 'field list'Error: INSERT INTO content2 (d1, d2, d3) VALUES (Julie, Dooley, 42)</p>
  <p>Unknown column 'Julie' in 'field list'Error: INSERT INTO content2
  (d1, d2, d3) VALUES (John, Doo, 24);</p>
  <p>Unknown column 'John' in 'field list'Error: INSERT INTO content2 (d1, d2, d3) VALUES (Mary, Moe, 36);</p>
  <p>Unknown column 'Mary' in 'field list'Error: INSERT INTO content2 (d1,
  d2, d3) VALUES (Julie, Dooley, 42);</p>
  <p>Unknown column 'Julie' in 'field list'</p>
  </blockquote>
  <p><strong>Here is my php code:</strong></p>
  <pre><code>//Get Connection
  require_once('connect.php');
  
  //Get Data
  $sql = &quot;SELECT d1, d2, d3 FROM content&quot;;
  $result = mysqli_query($con, $sql);
  
  if (mysqli_num_rows($result) &gt; 0) {
  // output data of each row
      while($row = mysqli_fetch_assoc($result)) {
          $row1 = $row[&quot;d1&quot;];
          $row2 = $row[&quot;d2&quot;];
          $row3 = $row[&quot;d3&quot;];
  
  //Insert Data to another table
              $sql = &quot;INSERT INTO content2 (d1, d2, d3)
              VALUES ($row1, $row2, $row3);&quot;;
              if (mysqli_multi_query($con, $sql)) {
                  echo &quot;New records created successfully&quot;;
              } else {
                  echo &quot;Error: &quot; . $sql . &quot;&lt;br&gt;&quot; . mysqli_error($con);
              }
          //echo &quot;id: &quot; . $row[&quot;d1&quot;]. &quot; - Name: &quot; . $row[&quot;d2&quot;]. &quot; &quot; . $row[&quot;d3&quot;]. &quot;&lt;br&gt;&quot;;
      }
  } else {
      echo &quot;0 results&quot;;
  }
  </code></pre>
  <p>I couldn't figure out what the problem are. Please Help</p>