Solved Adding a month to duedate

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

guitarzRus

Thread Starter
Joined
Jul 28, 2020
Messages
50
Hi, I have a database file with records including "duedates" and want to update them at end of
month. I have researched this and make no sense of manuals.
I tried this:
------------
PHP:
<?php

   $servername='localhost';

   $username='root';

   $password='';

   $dbname = "prerentdb";

   $conn=mysqli_connect($servername,$username,$password,"$dbname");

   if(!$conn){

      die('Could not Connect My Sql:' .mysql_error());

   }

if(count($_POST)>0) {

$amtpaid='amtpaid';

$amtdue='amtdue';

$duedate = strtotime(date("Y-m-d", strtotime($duedate)) . " +1 month"); // line 13

echo $duedate;

$prevbal='prevbal';

$latechg='latechg';

$secdep='secdep';

$damage='damage';

$courtcost='courtcost';

$nsf='nsf';

$hudpay='hudpay';

$datepaid='datepaid';

$paidsum='paidsum';

$Comment='Comment';


mysqli_query($conn,"UPDATE payfile set

id='" . $_POST['id'] . "',tenant='" . $_POST['tenant'] . "', unit='" . $_POST['unit'] . "',

amtpaid='" . $_POST['amtpaid'] . "' , duedate='" . $_POST['duedate'] . "',

prevbal='" . $_POST['prevbal'] . "', latechg='" . $_POST['latechg'] . "',

secdep='" . $_POST['secdep'] . "' , damage='" . $_POST['damage'] . "',

courtcost='" . $_POST['courtcost'] . "', nsf='" . $_POST['nsf'] . "',  hudpay='" . $_POST['hudpay'] . "',

datepaid='" . $_POST['datepaid'] . "', paidsum='" . $_POST['paidsum'] . "',

comment='" . $_POST['comment'] . "'

WHERE id='" . $_POST['id'] . "'");

$message = "Record Modified Successfully";

}
-------------------
and got this:
Notice: Undefined variable: duedate on line 13
2674800
--------------
Please help.
 
Last edited by a moderator:

Cookiegal

Karen
Administrator
Malware Specialist Coordinator
Joined
Aug 27, 2003
Messages
121,303
I edited your post to use the code tags as I asked you to do before in your other thread. Please always use code tags when posting code.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top