I have a problem with INSERT in PHP. I have a table named products_1 and another called products_2. Table 1 has the same products as the second, but with 5 more products, ie ID 11, 12, 13, 14 and 15 are not inserted in products_2. I need to "copy", insert this 5 products, at a time, into the products_2. And every time there are more products in the products_1 table.
I TRIED THAT, BUT HE INSERT ONLY ID 15, THE LAST>
if (!$db->Query("SELECT * FROM produtos_2 ORDER BY id DESC LIMIT 1"))
$db->Kill();
while (! $db->EndOfSeek()) {
$row = $db->Row();
$idprodutos2= $row->id;
}
mysql_query("INSERT INTO produtos_2 SELECT * FROM produtos_1 WHERE id > '.$idprodutos2.'");
"Let's get together"