Quote:
Hi, I have some issues with my code. It's to refresh account payfile at end of month. Comments are noted
in code (//).
#1) how to define variables as numeric(I've tried several examples(forums and manuals)
#2) how to add several variables together so they are known as numeric(they are all decimal 8,2 in the database)
#3) Please, someone explain the "Undefined variable: mysql".
Code:
<?php
//Open a new connection to the MySQL server
= mysqli_connect("localhost", "root", "", "prerentdb");
// Check connection
if( === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); }
//MySqli Select Query
= "select * FROM payfile";
echo "<center>";echo date('m/d/y');echo "<br />";
=0;
="prevbal";
="latechg";
="secdep";
="damage";
="courtcost";
="nsf";
="amtdue";
="amtpaid";
="paidsum";
= + + + + + ; // Warning: A non-numeric value encountered x 5 line 21
= + ; Warning: // A non-numeric value encountered x 1 line 22
// if no payment or partial payment, add $10 to latechg field and amount not paid to prevbal field
if ( < ) // Notice: Undefined variable: amtpaid
{ = + 10; = - ; }
// if payment = amtdue clear due
if ( == ) // Notice: Undefined variable: amtpaid
{ = 0; = 0; }
// if over-payment subtract over-payment
// from prevbal field
if ( > ) // Notice: Undefined variable: amtpaid
{ = - ; = 0; = 0; }
= 0; = 0; = 0; = 0;
// refresh every record - give every record the below values
= '0.00';
= '0.00';
= ' ';
= '0.00';
= ' ';
// Perform a query, check for error
if (! -> query("UPDATE payfile SET // Undefined variable: mysqli
Fatal error: Uncaught Error: Call to a member function query() on null
prevbal='',latechg='', hudpay='', amtpaid='',
datepaid='', comment='', paidsum=''
where unit = "));
mysqli_query() or die(mysql_error());
?>
Quote:
these are error messages:
Warning: A non-numeric value encountered in C:
mpp\htdocs\property
efreshpayments.php on line 21
Warning: A non-numeric value encountered in C:
mpp\htdocs\property
efreshpayments.php on line 21
Warning: A non-numeric value encountered in C:
mpp\htdocs\property
efreshpayments.php on line 21
Warning: A non-numeric value encountered in C:
mpp\htdocs\property
efreshpayments.php on line 21
Warning: A non-numeric value encountered in C:
mpp\htdocs\property
efreshpayments.php on line 21
Warning: A non-numeric value encountered in C:
mpp\htdocs\property
efreshpayments.php on line 21
Warning: A non-numeric value encountered in C:
mpp\htdocs\property
efreshpayments.php on line 22
Notice: Undefined variable: ampaid in C:
mpp\htdocs\property
efreshpayments.php on line 32
Notice: Undefined variable: mysqli in C:
mpp\htdocs\property
efreshpayments.php on line 44
Fatal error: Uncaught Error: Call to a member function query() on null on line 44