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' ('I 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 '));