If Statement (PHP)

Bakir Odeh

I need If Statement (php) to :

if (Modem = ModemNotReceived) and (CheckModem = Done) 

    Total + 50

And

    if (Modem = ModemReceived) and (CheckModem = Done)

    Total - 50

How i can do that in one if statement?

My Table :

| ID |       Modem          | CheckModem | Total
------------------------------------------------
| 1  |   ModemReceived      |    Done    | 120
------------------------------------------------
| 2  |   ModemNotReceived   |    Null    | 90
------------------------------------------------
| 3  |   ModemReceived      |    Null    | 100
Burning Crystals

If I understand what you're saying correctly, this code is what you mean:

<?php 
if ($Modem == 'ModemNotReceived' && $CheckModem == 'Done') {
    $Total += 50;
} else if ($Modem == 'ModemReceived') && $CheckModem == 'Done' {
    $Total -= 50;
}
?>

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

if statement within PHP Function

分類Dev

Execute Curl Statement in PHP

分類Dev

delete if/else statement in php

分類Dev

How to correct this if statement with OR and AND in PHP?

分類Dev

print (SELECT) statement by php

分類Dev

DELETE statement php MySQL

分類Dev

PHP select statement not working?

分類Dev

Is using a php if statement as a condition for a javascript if statement unorthodox?

分類Dev

Run JavaScript from PHP if statement

分類Dev

PHP while statement echoes duplicates

分類Dev

PHP CodeIgniter WHERE clause statement

分類Dev

PHP switch statement for Time & Date

分類Dev

PHP switch statement for Time & Date

分類Dev

IF Function in Mysql and PHP statement with LEAST()

分類Dev

php echo statement fails to execute

分類Dev

PHP - Join statement duplicates records

分類Dev

check if empty in php prepare statement

分類Dev

If-statement with !== is never true PHP

分類Dev

MYSQL PHP Foreach statement only submitting first insert into statement

分類Dev

Shorthand expression for an if ( $a == $b and $a == $c ) statement in PHP

分類Dev

PHP: Can somebody simplify this IF statement for me?

分類Dev

PHP If Statement if (!$_POST) - What does !$_POST mean?

分類Dev

Editing an html <div> inside a PHP statement

分類Dev

else, elseif,else statement is not working with fwrite in php

分類Dev

Using a PHP if statement to produce a hidden input field

分類Dev

php ifelse keep run else statement

分類Dev

php ifelse keep run else statement

分類Dev

HTML markup not displaying from within php if statement

分類Dev

Can't get a prepared statement to print in php

Related 関連記事

ホットタグ

アーカイブ