Table field replication problems

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

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.