2 problems: update calculated field and sum of fields
Posted: Mon Jun 02, 2003 3:37 am
hi,
i've got two problems:
1. i have calculated field in my form:
where field in database is not updated, i don't know why....
2. i'd like to display sum of any column...
but on the page i have "Resource id #9"...
what i'm doing wrong?
i've got two problems:
1. i have calculated field in my form:
Code: Select all
$a = $a //$a is from mysql
$b = $b //$b is from mysql
$c = $c //$c is from mysql
$d = $a * $b * $c
echo $d;
while ($row = mysql_fetch_row($mysql_result)) {
if ($rowї0] == $d) {
$query = "UPDATE table SET $d";2. i'd like to display sum of any column...
Code: Select all
$query = "SELECT SUM(column_name) FROM table" ;
$mysqlresult = mysql_query($query);
echo $mysqlresult;what i'm doing wrong?