I am using a MySQL statement to copy data from one table to another.
$sql2 = "INSERT one SELECT id, user_id, name FROM two WHERE user_id='1'";
Both tables are using the same columns: id, user_id and name.
I want to copy the data from table two to table one. When I execute the script I can see that all the data in table two is copied to table one. Also the column id.
I want to keep the id in table one as a unique value. I dont want to copy the id from table two to one. I just want to copy the columns user_id and name and want to auto increment the id in table one.
When I execute the script without id I get a error that says that the colums in one and two are not the same.
Does someone know how I can solve this problem and copy the data without the id column