时间:2021-07-01 10:21:17 帮助过:19人阅读
//方法一 while($result=mysql_fetch_array($query)){ $bgcolor=($bgcolor=="blue") ? "white" : "blue"; echo ""; echo " "; } //方法二 $flag=1; while($result=mysql_fetch_array($query)){ if($flag % 2 == 0) $bgcolor="yellow";else $bgbolor="white"; //这种方式理论上可以阿 echo "{$result['gname']} "; echo "{$result['endtime']} "; echo "{$result['current_price']} "; echo "{$result['reply_num']} "; echo ""; echo " "; $flag++; }{$result['gname']} "; echo "{$result['endtime']} "; echo "{$result['current_price']} "; echo "{$result['reply_num']} "; echo "