我尝试从表格中打印出所有用户电子邮件,但我希望奇数打印为红色,偶数打印为蓝色。如何在while循环中做到这一点?
$connect=mysql_connect("localhost", "root", "");
$database=mysql_select_db("phplogin", $connect);
$SQL=mysql_query("SELECT * FROM users");
$num=mysql_num_rows($SQL);
$start=0;
while($start<$num){
$result_id=mysql_result($SQL, $start, "id");
$result_email=mysql_result($SQL, $start, "email");
echo "<b style='color:red'>" . $result_id . $result_email . "</b><br/>";
echo "<b style='color:blue'>" . $result_id . $result_email . "</b><br/>";
$start++;
}