$get="SELECT dial_prod_total FROM dial_product WHERE dial_prod_id='$dpname'";
$idgen=mysql_query($get) or die(mysql_error());
$total=$idgen+$dpqty;
$dpbuy="UPDATE dial_product set dial_prod_total= '$total'".
"WHERE dial_prod_id='$dpname'";
$result1=mysql_query($dpbuy) or die(mysql_error());
I want to get the data in the column dial_prod_total using the ID stored in $dpname and then update the value and store in the same column. The value is replaced in the column but it's not the correct value. What is the mistake I have made? Please help me.
mysql_*functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which.