mysql_query("insert into mytable (flow,holderid,amount,operator,ip,product,taskid,comment)values('-1','$memberid','$sum+5','$memberid','$ip','Expertise','$taskid','Publish a problem or task') ")or die(mysql_error());
I get an error about
‘$sum+5’
MySQL doesn’t treat it as an and operation, how to resolve this problem?
If you want MySQL to perform the addition, drop the single quotes around the addition; they make MySQL interpret the expression as a string (just as PHP would). If you want PHP to perform the addition, do as fucla writes.