With the Jane's kind help I've been successfully using calculations/display with the data from different tables. However max() does not appear working. Where is my error?
my code is
[codebox]$values['a'] = $data1['b'] + max($data2['c'],$data2['d']);[/codebox]
where $data1['b'] is successfully got from table1,
$data2['c'] is successfully got from table2,
$data2['d'] is successfully got from table2, (I mean, it works if I remove max()
['a'] is the field in table3.
Found a solution (but not the error): <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=4861&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' /> at http://php.net/manual/en/function.max.php from nonick@8027.dot.org
[codebox]$values['a'] = $data['b']+(($c > $d) ? $c : $d);[/codebox]