Now there are table A and table 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 area
Now I want to copy the a table field into the B record,
The following structure:
ID model field Name setting CSS
1 area
2 Username user Name
3 genre Sex
4 Pattern Positions
The manual didn't turn out, the novice consulted
Reply to discussion (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);
Get the information of the fields in the table, how to deal with the landlord to write their own sentences decided
PHP reads the log to the array, then takes the array key value to write the database again, this already knew. Now you want to write directly with SQL.
Fortunately in the SQL section to find the answer, all table fields are recorded by MySQL