Click here to Skip to main content
15,887,364 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
amtpaid, prevbal, latechg, etc. are database fields that are: decimal 8,2 and may be 0.00 or more:

I'm asking for the correct way to code these variables to reflect their value

Obviously I'm resetting the values of the fields to 0 since after update, no matter the amtpaid,
prevbal, latechg, etc. are always 0.00

>

What I have tried:

and been advised:
$amtpaid = (double)'amtpaid';,
$amtpaid=$row['amtpaid'];,
$amtpaid = (int)'amtpaid';
$amtpaid = 0;
Posted
Updated 5-Apr-23 14:31pm
v2
Comments
Member 15627495 4-Apr-23 1:30am    
$amount = 0 ; // value 0
$amount = $row['0']['amtpaid'] ; // by FETCH_ASSOC with lot of rows
$amount = $row['0'] ; // one field at index 0
$amount = $_POST ; // a full $_POST array in the var
$amount = $_GET['name'] ;// the field 'name' in $_GET
$amount = $_COOKIE['id'] ; the value for 'id' pick in the cookie
$amount; // discarding the value in, or init a var without value. Php is in C/C++ tail language

// as Php is very reliable with "T types" (int) and (double) are 'optional' on lot of servers. those are cast operator, converting Type to one another.

unset($amount) ; // free the var and its value, very good when big bunch of datas in a var, or object ( db / db result / curl ... )

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900