How to remove the comment contents of a field in MySQL with PHP
How can php remove the comment content of a field from MySQL, such as a table built in the following statement, and use the MySQL function in PHP to take out the comment content of each field?
CREATE TABLE IF not EXISTS ' zy_article ' (
' id ' int (ten) unsigned not NULL auto_increment COMMENT ' id ',
' user_name ' varchar DEFAULT NULL COMMENT ' user name ',
' Article_type ' int (one) DEFAULT NULL COMMENT ' belongs to Category ',
' Article_title ' varchar (255) DEFAULT NULL COMMENT ' article title ',
' article_content ' text not NULL COMMENT ' article content ',
' Post_date ' datetime DEFAULT NULL COMMENT ' Publish Time ',
' Click_num ' int (one) not NULL DEFAULT ' 0 ' COMMENT ' hit count ',
' Comment_num ' int (one) not NULL DEFAULT ' 0 ' comment ' comment count ',
' Article_tags ' text COMMENT ' article tag ',
' Author ' varchar (+) DEFAULT NULL COMMENT ' author ',
' Derivation ' varchar (255) DEFAULT NULL COMMENT ' provenance ',
' Iscommend ' char (1) not NULL DEFAULT ' 0 ' COMMENT ' is recommended ',
PRIMARY KEY (' id ')
) Engine=myisam DEFAULT charset=latin1 auto_increment=80;
------Solution--------------------
Using the show command
SHOW TABLE STATUS; Or
Mysqlshow--status TABLE;
------Solution--------------------
Wrong, it should be used.
Show full fields from ' Table name '
------Solution--------------------
PHP code
function show_fields ($sql) {$result =mysql_que Ry ($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 '));