mysql教程:读取数据表字段名 mysql_fetch_field()
现在我们来看看 mysql_fetch_field() 函数吧,这个函数 是就读取mysql 数据表的例名,字段名.下面我们来看看它的语法哦.
mysql_fetch_field(data,field_offset)
<p><strong>mysql_fetch_field()</strong> 函数对像是记录集返回.mysql_query ( )函数并返回一个对象上的成功,或FALSE或失败时</p><p> </p><p>他有两个参数.data 与 field_offset</p><p> </p><p>data:必选若,指定的数据指针使用。数据指针是由于从mysql_query ( )函数</p><p> </p><p>field_offset:可选,从哪条记录开始读取,不写是代码从0开始.</p><p> </p><p>现在我们来看一个mysql_fetch_field实例.</p><p></p><pre class="brush:php;toolbar:false">$sql = "SELECT * from a";
$result = mysql_query($sql,$con);
while ($property = mysql_fetch_field($result))
{
echo "Field name: " . $property->name . "
";
}
输出的结果就是你数据表的所有字段名哦.

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver CS6
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
