我需要If语句(php)来:
if (Modem = ModemNotReceived) and (CheckModem = Done)
Total + 50
And
if (Modem = ModemReceived) and (CheckModem = Done)
Total - 50我怎么能在一次陈述中做到这一点?
我的桌子:
| ID | Modem | CheckModem | Total
------------------------------------------------
| 1 | ModemReceived | Done | 120
------------------------------------------------
| 2 | ModemNotReceived | Null | 90
------------------------------------------------
| 3 | ModemReceived | Null | 100发布于 2015-05-16 06:25:31
如果我正确理解你的意思,这段代码就是你的意思:
<?php
if ($Modem == 'ModemNotReceived' && $CheckModem == 'Done') {
$Total += 50;
} else if ($Modem == 'ModemReceived') && $CheckModem == 'Done' {
$Total -= 50;
}
?>https://stackoverflow.com/questions/30272467
复制相似问题