Hi, I've been trying to solve this for far too long. Trying to define variables as numeric. My
database fields are numeric(0.00, 10.00 etc.). I can't say "$prevbal=0.00;" or "$prevbal=10.00;" etc.
as all the tutorials describe. I remember seeing reference to something like "(int)sc;" but relocate it.
My statement
"$due = $prevbal + $latechg + $secdep + $damage + $courtcost + $nsf;" produces "Warning: A non-numeric
value encountered in C: on line 108". I could use help.
My code:
<?php
$prevbal='prevbal';
$latechg="latechg";
$secdep="secdep";
$damage="damage";
$courtcost="courtcost";
$nsf="nsf";
$paidsum="paidsum";
$comments="comments";
$id="id";
$due="due";
// Attempt select query execution
$result = mysqli_query($conn,"SELECT * FROM payfile Where amtpaid =''");
$row= mysqli_fetch_array($result);
$due = $prevbal + $latechg + $secdep + $damage + $courtcost + $nsf; // line 108
$owed = $due + $amtdue; // line 109
/* if no payment or partial payment, add $10 to latechg field and amount not paid to prevbal field */
if ($amtpaid < $owed)
{ $latechg = $latechg + 10.00; $prevbal = $owed - $amtpaid; }
/* if payment = amtdue clear due */
if ($amtpaid == $owed)
{ $prevbal = 0.00; $latechg = 0.00; $secdep = 0.00; $damage = 0.00; $courtcost = 0.00; $nsf = 0.00; }
/* if over-payment subtract over-payment from prevbal field */
if ($amtpaid > $owed )
{ $prevbal = $amtpaid - $owed; $latechg = 0.00; $secdep = 0.00; $damage = 0.00; $courtcost = 0.00;
$nsf = 0.00; }
$amtpaid = $paidsum;
database fields are numeric(0.00, 10.00 etc.). I can't say "$prevbal=0.00;" or "$prevbal=10.00;" etc.
as all the tutorials describe. I remember seeing reference to something like "(int)sc;" but relocate it.
My statement
"$due = $prevbal + $latechg + $secdep + $damage + $courtcost + $nsf;" produces "Warning: A non-numeric
value encountered in C: on line 108". I could use help.
My code:
<?php
$prevbal='prevbal';
$latechg="latechg";
$secdep="secdep";
$damage="damage";
$courtcost="courtcost";
$nsf="nsf";
$paidsum="paidsum";
$comments="comments";
$id="id";
$due="due";
// Attempt select query execution
$result = mysqli_query($conn,"SELECT * FROM payfile Where amtpaid =''");
$row= mysqli_fetch_array($result);
$due = $prevbal + $latechg + $secdep + $damage + $courtcost + $nsf; // line 108
$owed = $due + $amtdue; // line 109
/* if no payment or partial payment, add $10 to latechg field and amount not paid to prevbal field */
if ($amtpaid < $owed)
{ $latechg = $latechg + 10.00; $prevbal = $owed - $amtpaid; }
/* if payment = amtdue clear due */
if ($amtpaid == $owed)
{ $prevbal = 0.00; $latechg = 0.00; $secdep = 0.00; $damage = 0.00; $courtcost = 0.00; $nsf = 0.00; }
/* if over-payment subtract over-payment from prevbal field */
if ($amtpaid > $owed )
{ $prevbal = $amtpaid - $owed; $latechg = 0.00; $secdep = 0.00; $damage = 0.00; $courtcost = 0.00;
$nsf = 0.00; }
$amtpaid = $paidsum;