Table field replication problems currently include table A & nbsp; and table BA structure id & nbsp; username & nbsp; genre & nbsp; pattern1 & nbsp; mr. a & nbsp; 0 & nbsp; & Table field copy
Currently, tables A and B are available.
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.
------ Solution --------------------
$link = mysql_connect("localhost", "root", "pwd") or die("Could not connect: " . mysql_error());
mysql_select_db("dbName", $link);
$result = mysql_query("show fields from tableName") or die("Could 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?