用PHP怎么取出MYSQL中的字段的comment内容
用PHP如何取出MYSQL中的字段的comment内容
用PHP如何取出MYSQL中的字段的comment内容,如下面的语句建的表,如何使用PHP中的MYSQL函数取出每个字段的comment内容?
CREATE TABLE IF NOT EXISTS `zy_article` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_name` varchar(20) DEFAULT NULL COMMENT '用户名',
`article_type` int(11) DEFAULT NULL COMMENT '所属类别',
`article_title` varchar(255) DEFAULT NULL COMMENT '文章标题',
`article_content` text NOT NULL COMMENT '文章内容',
`post_date` datetime DEFAULT NULL COMMENT '发布时间',
`click_num` int(11) NOT NULL DEFAULT '0' COMMENT '点击次数',
`comment_num` int(11) NOT NULL DEFAULT '0' COMMENT '评论次数',
`article_tags` text COMMENT '文章标签',
`author` varchar(100) DEFAULT NULL COMMENT '作者',
`derivation` varchar(255) DEFAULT NULL COMMENT '出处',
`iscommend` char(1) NOT NULL DEFAULT '0' COMMENT '是否推荐',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=80 ;
------解决方案--------------------
使用Show命令
SHOW TABLE STATUS; or
mysqlshow --status TABLE;
------解决方案--------------------
错了,应该用
show full fields from '表名称'
------解决方案--------------------
- PHP code
function show_fields($sql) { $result=mysql_query($sql); $data=array(); while ($row=mysql_fetch_array($result)) { $data[]=$row['Field']; } return $data; } <br><font color="#e78608">------解决方案--------------------</font><br>调用:<br>print_r(show_fields('show full fields from zy_article')); <div class="clear"> </div>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Comment means remarks and annotations. In the MySQL database, comments on fields or columns are added using the comment attribute; in scripts that create new tables, comments can be added by adding the comment attribute in the field definition script. If you want to view the comments of all fields of an existing table, you can use the "showfullcolumnsfrom table name" command. In mysql, COMMENT means remarks and comments. MySQL adds comments (comment) In the MySQL database, comments on fields or columns are added using the comment attribute. In the script that creates a new table, you can add comments by adding the comment attribute in the field definition script. The sample code is as follows: c

The difference between null and NULL in C language is: null is a macro definition in C language, usually used to represent a null pointer, which can be used to initialize pointer variables, or to determine whether the pointer is null in a conditional statement; NULL is a macro definition in C language A predefined constant in , usually used to represent a null value, used to represent a null pointer, null pointer array or null structure pointer.

In JavaScript, both undefined and null represent the concept of "nothing": 1. undefined represents an uninitialized variable or a non-existent property. When a variable is declared but no value is assigned to it, the value of the variable is undefined , when accessing properties that do not exist in the object, the returned value is also undefined; 2. null represents an empty object reference. In some cases, the object reference can be set to null to release the memory it occupies.

Both null and undefined indicate a lack of value or an undefined state. Depending on the usage scenario, there are some guiding principles for choosing to use null or undefined: 1. When you need to clearly indicate that a variable is empty or invalid, you can use null; 2. When a variable has been declared but not yet assigned a value, it will be set to undefined by default; 3. When you need to check whether a variable is empty or undefined, use the strict equality operator "===" to determine whether the variable is null or undefined. .

The difference between null and undefined is: 1. Semantic meaning; 2. Usage scenarios; 3. Comparison with other values; 4. Relationship with global variables; 5. Relationship with function parameters; 6. Nullability check; 7. Performance considerations; 8. Performance in JSON serialization; 9. Relationship with types. Detailed introduction: 1. Semantic meaning, null usually means knowing that this variable will not have any valid object value, while undefined usually means that the variable has not been assigned a value, or the object does not have this attribute; 2. Usage scenarios, etc.

Steps to configure default gateway: 1. Determine the IP address of the router; 2. Open the network configuration interface of the computer; 3. Configure network connection; 4. Configure IPv4 settings; 5. Enter the IP address and subnet mask; 6. Configure the default gateway ;7. Configure DNS server; 8. Save settings. Detailed introduction: 1. Determine the router's IP address. The default gateway address is usually the router's IP address. You can find the router's IP address on the back of the router or in the user manual; 2. Open the computer's network configuration, etc.

Steps to configure default gateway: 1. Open the control panel; 2. Select Network and Internet; 3. Configure network connection; 4. Configure IP address; 5. Configure DNS server address; 6. Confirm the configuration; 7. Restart the network device. Detailed introduction: 1. Open the Control Panel, in Windows system, click the Start menu, select "Control Panel"; 2. Select Network and Internet, in the Control Panel, select "Network and Internet"; 3. Configure network connections, etc. .

Usage: 1. Initialize the reference type variable to null, indicating that the variable does not currently point to any object; 2. Set the reference type variable to null, which can release the memory space of the object referenced by the variable and help the garbage collector to recover This object; 3. Use null to check whether a reference is empty. You can avoid the occurrence of NullPointerException by judging whether the reference is null. 4. Use null in conditional judgment to judge whether a reference is empty.
