title: ODBC/MYSQL Insert a Query Result from ODBC to a databse in MYSQL
body: <p>I'm connecting to a cloud database through an ODBC connection:</p>
  
  <pre><code>$conn = odbc_connect('MYDATABASE','','');
  if (!$conn) {
      exit("Connection Failed: " . $conn);
  }
  
  $sql = "SELECT DATETIME_ID, NAME, Sum(CNDROP) AS DATA
          FROM   MY_TABLE
          WHERE DATETIME_ID&gt;='2014-09-28:00:00:00'
            and DATETIME_ID&lt;='2014-09-28 23:00:00'
            and NAME IN ('CC2')
          GROUP BY DATETIME_ID, NAME ORDER BY DATETIME_ID, NAME";
  
  $rs = odbc_exec($conn,$sql);
  if (!$rs) {
      exit("Consulta fallida");
  }
  
  $result = odbc_exec($conn,$sql) or die(exit("Error en odbc_exec"));
  print odbc_result_all($result,"border=1");
  
  odbc_close($conn);
  </code></pre>
  
  <p>I can get the data, and print the data, but now I need insert that data into a MySQL database into my computer.</p>
  
  <p>I don't have any idea how to do it, so I need help with an example. I tried to search on google but nothing was helpful.</p>