I have no clear idea of what you are trying, but this here is definitively wrong:
$z=mysql_query("UPDATE levels SET bal=bal-'$new[$i]' WHERE itemsize= '$item[$i]'");
$result=mysql_query($z);
The result of the mysql_query function is a ressource identifier which you cannot use as input for the same function.
smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254
One thing is that mysql itself takes care and do not update a row if there is no change.
Still if you want to include it in your code, then when you load your page with database values, then you also add one more hidden field, say original_qty,
Now when your process your data from html form. you compare qty and original_qty column, if both are not matching then only execute update query
urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270