need help w/code

Discussion in 'PHP' started by pshaw, Jun 1, 2021.

  1. #1
    Hi, will someone tell me the correct way to clear these fields.
    --------------------------------------------------
    php code;
    $zero=0;
    // if over-payment subtract over-payment from prevbal field and clear misc chgs
    else ($rentpaid > $rentdue )
    { $rentdue = $rentpaid - $rentdue. $prevbal = $zero. $latechg = $zero.
    $secdep = $zero. $damage = $zero. $courtcost = $zero. $nsf = $zero. }
     
    pshaw, Jun 1, 2021 IP
  2. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #2
    Where is the code
     
    JEET, Jun 1, 2021 IP
  3. pshaw

    pshaw Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    php code; VVVVVVVVVVVVVVVVVV
    $zero=0;
    // if over-payment subtract over-payment from prevbal field and clear misc chgs
    else ($rentpaid > $rentdue )
    { $rentdue = $rentpaid - $rentdue.
    $prevbal = $zero.
    $latechg = $zero.
    $secdep = $zero.
    $damage = $zero.
    $courtcost = $zero.
    $nsf = $zero. }
    PHP:
     
    Last edited by a moderator: Jun 1, 2021
    pshaw, Jun 1, 2021 IP
  4. pshaw

    pshaw Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    I want to update the fields to zero and I get message: Parse error - unexpected ';'
     
    pshaw, Jun 2, 2021 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    1) Where's the IF that ELSE is for?

    2) why are you doing string additions between assignments? Did you mean for all those periods to be semi-colons?

    3) Why the variable for nothing. Zero is zero...
     
    deathshadow, Jun 8, 2021 IP
  6. FrogeHost

    FrogeHost Member

    Messages:
    39
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    33
    #6
    This entire snippet does not make any sense.
     
    FrogeHost, Jun 8, 2021 IP