我在mssql表中有一个列,其中包含从1到101的数字。使用While和if else if语句可以很好地工作。我需要添加的能力,以获得101的灰度图像。这需要修改黄色图像的else if语句,但无法使其工作。请检查下面的示例,并告诉我哪里出错了。谢谢。
作品:
while ($row8 = mssql_fetch_array($result8)) {
if ($row8['IPscore'] > 85) { // Get Green image
$row8['ScoreIND'] = $Good;
}
else if ($row8['IPscore'] < 69) { // Get Red image
$row8['ScoreIND'] = $Bad;
}
else {
$row8['ScoreIND'] = $Fair; // Get Yellow image
}失败:
if ($row8['IPscore'] > 85) { // Get Green image
$row8['ScoreIND'] = $Good;
}
else if ($row8['IPscore'] < 69) { // Get Red image
$row8['ScoreIND'] = $Bad;
}
else if ($row8['IPscore'] (>70 and <84)) { // Get Yellow image
$row8['ScoreIND'] = $Fair;
}
else ($row8['IPscore'] == 101) { // Get Grey image
$row8['ScoreIND'] = $LowVol;
}获取错误:意外的'>',应为')‘
发布于 2011-06-13 08:22:35
else if ($row8['IPscore'] (>70 and <84)) { 改变为;
else if ( $row8['IPscore'] > 70 and $row8['IPscore'] < 84 ) { 编辑:也存在逻辑错误。检查IPscores从大到小。
if($row8['IPscore'] == 101) { // Get Grey image
$row['ScoreIND'] = $LowVol;
}else if ($row8['IPscore'] > 85) { // Get Green image
$row8['ScoreIND'] = $Good;
}else if ( $row8['IPscore'] > 70 and $row8['IPscore'] < 84 ) { // Get Yellow image
$row8['ScoreIND'] = $Fair;
}else if ($row8['IPscore'] < 69) { // Get Red image
$row8['ScoreIND'] = $Bad;
}https://stackoverflow.com/questions/6325617
复制相似问题