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
$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.
month. I have researched this and make no sense of manuals.
I tried this:
------------
<?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.