mysqli prepared update

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bytM3
    New Member
    • May 2021
    • 6

    mysqli prepared update


    hi, new to this. Will someone tell me why this doesn't update?

    Code:
    <?php
    // Include config file
    include 'getprerentdb.php';
    
    $amtdue = 0.00;  // ****************************************
    $duedate='duedate';
    $prevbal=0.00;
    $latechg=0.00;
    $secdep=0.00;
    $damage=0.00;
    $courtcost=0.00;
    $nsf=0.00;
    $paidsum=0.00;
    $id="id";
    $receiptno='0';
    
    $sql = "UPDATE payfile SET
    amtpaid=?, duedate=DATE_ADD(?, INTERVAL 1 month), prevbal=?, latechg=?, secdep=?, damage=?, courtcost=?, nsf=?, hudpay=?, datepaid=?, paidsum=?
    WHERE id=?";  
    $stmt = $conn->prepare($sql);
    $stmt->bind_param("dsdddddddsdi", $amtpaid, $duedate, $prevbal, $latechg, $secdep, $damage, $courtcost, 
    $nsf, $hudpay, $datepaid,  $paidsum,  $id);
    $stmt->execute();
    ?>
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    #2
    Hi,

    What error messages are you seeing?

    From what you have posted I can see that amtpaid, hudpay and datepaid are not declared and you have set duedate to 'duedate'.

    Gaz

    Comment

    Working...