int mysqli_num_fields ( mysqli_result $result );
它返回输出集中的字段数。
Sr.No | 参数 & Description |
---|---|
1 |
result 它是由mysqli_query()、mysqli_store_result()或mysqli_use_result()返回的输出集标识符 链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-mysqli-num-fields.html 来源:LearnFk无涯教程网 |
它返回输出集中的字段数。
<?php $connection_mysql=mysqli_connect("localhost","user","password","db"); if (mysqli_connect_errno($connection_mysql)){ echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql="SELECT name FROM emp"; if ($result=mysqli_query($connection_mysql,$sql)){ $fieldcount=mysqli_num_fields($result); print $fieldcount; mysqli_free_result($result); } mysqli_close($connection_mysql); ?>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)
PPT设计进阶 · 从基础操作到高级创意 -〔李金宝(Bobbie)〕