php获取mysql数据库中表字段名称

php获取mysql数据库中表字段名称<br /> <br /> &lt;?php <br /> $conn=mysql_connect(&quot;localhost&quot;,&quot;用户名&quot;,&quot;密码&quot;) or die(&quot;链接失败&quot;);<br /> mysql_select_db(&quot;数据库名&quot;);<br /> $sql=&quot;select * from 表名&quot;;<br /> $result=mysql_query($sql);<br /> echo mysql_field_name($result,0);<br /> echo '&lt;br&gt;';<br /> echo mysql_field_name($result,1);<br /> ?&gt;
返回顶部 留言