Home > Backend Development > PHP Tutorial > 如何在条件查询时输出条目数量统计

如何在条件查询时输出条目数量统计

WBOY
Release: 2016-06-23 13:30:46
Original
1044 people have browsed it

查询代码

 $sql = "SELECT * FROM record where bumen like'%$bumen' and keduimokuai like '%$keduimokuai' and keti like '%$keti' and xingming like'%$xingming%'";	  $result = mysql_query($sql);       ?>  	  <div style="margin:0 auto; width:100%; padding-top:10px;">		<b class="tableTitle"><a id="a">表名:培训台账查询</a></b><br />		<a href="search.html" id="fanhui"><b>返回</b></a>		</div>		  <table width="100%" border="1">			<tr class="biaotou">			  <td width="35">序号</td>			  <td width="60">部门</td>			  <td width="60">科队/模块</td>			  <td width="50">姓名</td>			  <td width="80">培训时间</td>			  <td width="150">培训课题</td>			  <td width="250">培训心得</td>			 </tr>			<?php							while($row = mysql_fetch_row($result))			{				echo '<tr>'; 				foreach($row as $v) 				echo "<td>$v</td>";			    echo '</tr>';			}					?>	</table>
Copy after login

查询已经实现 怎么统计查询出来的数量并且输出?


回复讨论(解决方案)

$count=mysql_num_rows($result);

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template