Table field replication currently involves tables A and B.
A structure
Id username genre pattern
1 mr. a 0 sales
2 mr. B 1 manager
3 mr. c 0 sales
B structure
Id model field name setting css
1 12 area
Now I want to copy the table field to the B table record,
The structure is as follows:
Id model field name setting css
1 12 area
2 15 username
3 15 genre gender
4 15. pattern position
I did not translate the manual. I am a beginner.
Reply to discussion (solution)
$ Link = mysql_connect ("localhost", "root", "pwd") or die ("cocould not connect :". mysql_error (); mysql_select_db ("dbName", $ link); $ result = mysql_query ("show fields from tableName") or die ("cocould not query :". mysql_error (); while ($ re = mysql_fetch_array ($ result) {echo $ re [0]; echo'
';} Mysql_close ($ link );
I have obtained the field information in the table. how can I deal with it?
Php reads records to the array, obtains the array key value, and writes the records to the database. Now I want to write data directly using SQL.
It's better to find the answer in the SQL section. all table fields are recorded by mysql.