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

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

WBOY
WBOYOriginal
2016-06-13 12:33:08877browse

在遍历结果集中判断两次循环的值是否都为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 />

Statement:
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