Home > Backend Development > PHP Tutorial > 在遍历结果集中判断两次循环的值是不是都为0

在遍历结果集中判断两次循环的值是不是都为0

WBOY
Release: 2016-06-13 12:33:08
Original
860 people have browsed it

在遍历结果集中判断两次循环的值是否都为0
就是说   A表有10条数据,字段为phone,select之后   用while遍历,在while里面进行判断,$i的phone值与$i+1的phone值如果都等于0,那么进行相关操作。  这个循环该怎么写

代码已经写到这:

<br />
$i=0;<br />
while ($row = $db->fetch_array($result)){<br />
	$i++;<br />
	}<br />
Copy after login

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