Home > Backend Development > PHP Tutorial > php数组处理解决办法

php数组处理解决办法

WBOY
Release: 2016-06-13 12:35:24
Original
877 people have browsed it

php数组处理

<br />
$sql = "SELECT b.lotno as lotno,count(b.lotno) as count FROM `kw_manage` as a inner join `vp_barcode_2d_y` as b on a.packageno = b.packageno where a.cust_no = '".$newstr."' group by lotno order by lotno asc";<br />
$result = mysql_query($sql);<br />
while($var = mysql_fetch_array($result,MYSQL_ASSOC))<br />
{<br />
     echo $var['lotno'].' * '.($var['count']).'<br />';<br />
}<br />
Copy after login


得到结果:
3206 * 12
3207 * 63
3218 * 180

能不能做到以下处理结果?当count对应的数量之和为100时,显示
3206 * 12
3207 * 63
3218 * 25
总和100之外的数据显示
3218 * 155

Related labels:
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