How to use PHP to retrieve comment content of MYSQL fields

Source: Internet
Author: User
Use PHP to retrieve comment content of MYSQL fields, as shown in the following statement, how can I use the MYSQL function in PHP to retrieve the comment content of each field? CREATETABLEIFNOTEXISTS 'zy _ article' ('id' int (10) unsignedNOTNULLAUTO_ I how to use PHP to retrieve comment content of MYSQL fields
How can I use PHP to retrieve the comment content of MYSQL fields, the table created using the following statements, and how can I use the MYSQL function in PHP to retrieve the comment content of each field?

Create table if not exists 'zy _ article '(
'Id' int (10) unsigned not null AUTO_INCREMENT COMMENT 'id ',
'User _ name' varchar (20) default null comment 'username ',
'Article _ type' int (11) default null comment' category ',
'Article _ title' varchar (255) default null comment 'Article title ',
'Article _ content' text not null comment' article content ',
'Post _ date' datetime default null comment' publication time ',
'Click _ num' int (11) not null default '0' comment' click times ',
'Comment _ num' int (11) not null default '0' comment' comment times ',
'Article _ tags' text comment' article tags ',
'Author' varchar (100) default null comment' author ',
'Derivation' varchar (255) default null comment' source ',
'Iscommend' char (1) not null default '0' comment' recommend ',
Primary key ('id ')
) ENGINE = MyISAM default charset = latin1 AUTO_INCREMENT = 80;

------ Solution --------------------
Use the Show command
Show table status; or
Mysqlshow -- status TABLE;
------ Solution --------------------
Wrong. use
Show full fields from 'table name'

------ Solution --------------------
PHP code
Function show_fields ($ SQL) {$ result = mysql_query ($ SQL); $ data = array (); while ($ row = mysql_fetch_array ($ result )) {$ data [] = $ row ['field'];} return $ data ;}
------ Solution --------------------
Call:
Print_r (show_fields ('Show full fields from zy_article '));

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.