I want to do the following: SELECT column1, column2, column3 etc FROM table_name then INSERT column1, column2, column3 etc INTO table_name2 I can get the results from the first table, but I don't know really how to insert those results into the second table.
I thought it was something like that, but I've never used arrays before. Could you show how to do it please?
$sql = "select * from table_name"; $query = mysql_query($sql); $row = mysql_fetch_assoc($query); $sql = "insert into table_name2(column1,column2,column3) values('".$row['column1']."','".$row['column2']."','".$row['column2']."')"; mysql_query($sql); PHP: thank should work and you can put this in a for or something