Need help with a return problem
Posted: Sat Aug 01, 2009 9:31 pm
I am entering PHP into an application that updates an mySQL database.
I have entered this code (which takes the weight of a product from a csv file and manipulates it the way I want and places it into the $products[weight] table and field of the mySQL database):
If $actual_value does = 0, I want the current weight in the database to be preserved instead of a 0 being returned as is always the case, no matter what I try.
Any Help????
I have entered this code (which takes the weight of a product from a csv file and manipulates it the way I want and places it into the $products[weight] table and field of the mySQL database):
Code: Select all
$actual_value = $P[5];
if ($actual_value > 0) {
$temp1 = $actual_value + .25;
$temp2 = $temp1 * 2;
$temp3 = round($temp2, 0);
return($temp3 / 2);
} else {
*this is what I can't get to work*
}Any Help????