Home > Backend Development > PHP Tutorial > 循环取值有关问题

循环取值有关问题

WBOY
Release: 2016-06-13 13:08:59
Original
1020 people have browsed it

循环取值问题
页面

1
2
3



//从数据库取值后
while($re = mysql_fetch_array()){

如果我数据为1时,我想
1
变成
1


}

出来页面的结果就是
1
2
3



怎么能实现呢,谢谢了

------解决方案--------------------
这你就用jquery取div中的值,然后跟php获取的值比较,给个变量赋值class类就好了
------解决方案--------------------
$index = 0;
while($re = mysql_fetch_array()){
$index++;
if($index == $re['字段'])
$class = 'class="checkedBtn"';
echo '
1
';
}
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