How to remove the comment contents of a field in MySQL with PHP

Source: Internet
Author: User
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 '));
  • 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.