1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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. }
    SEMrush
     
    pshaw, Jun 1, 2021 IP
    SEMrush
  2. JEET

    JEET Notable Member

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

    pshaw Greenhorn

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #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:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #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,494
    Likes Received:
    1,925
    Best Answers:
    247
    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 Peon

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