Table field replication problems

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.