Hello,

PHP Code:
$getsum1 = @mysql_query('select sum(product) as summ from tempo');  // calculating sum of values in a column named product
$row mysql_fetch_array($getsum1);   // fetching the result into an array
$sumtot $row['summ'];  // the result, which is number in decimals is returned as a string e. 
I need this value for additional mathematical operation, but $sumtot is storing the value as string, hence I have to convert it into double.
Instead of
PHP Code:
$sumtot $row['summ']; 
I use
PHP Code:
$sumtot doubleval($row['summ']);
echo (
var_dump($sumtot)); // confirms that $sumtot holds a double value 
PHP Code:
$finq = @mysql_query('update tempo set percent = (product*100)/$sumtot'); // using the sumtot to calculate percentage and update the same 
This query is failing, the fields are not getting updated, what is wrong?