Perfidus Posted October 14, 2007 Share Posted October 14, 2007 I've been trying to find out what the hell is going on with this form, but I can't figure it out. It should take the values of a number of fields and after calculate a 5% increment. For the firts value it does it OK but for the following it brings a different result ( the same for all the rest but definitively not the +5%) The code for the form: <input name="desc[]" type="text" value="WHATEVER ARTICLE" size="100"> <input name="precio[]" type="text" id="precio5" value="25.00"> <input name="incr[]" type="checkbox" id="incr[]" value="98930" /> <input type="hidden" name="incremento" value="5" ></td> <input type="hidden" name="numresult" value="4" ></td> The code for the 5% increment if($incremento != 0 || $incremento != ''){ for($i=0;$i<$numresult;$i++){ $incrementar = "UPDATE productos SET precio = ($precio[$i] + (($precio[$i] * $incremento) / 100)) WHERE (referencia='$incr[$i]')"; $incremento = mysql_query($incrementar) or die(mysql_errno().'<p>'.$incrementar.'</p>'); } } [move]in the first case I get the 26'25 (25 + 5%) but in the following I get 25'25 !!!!! [/move] Link to comment https://forums.phpfreaks.com/topic/73191-stinky-form/ Share on other sites More sharing options...
GingerRobot Posted October 14, 2007 Share Posted October 14, 2007 With all due respect, i have better things to do with my time than wait for a marquee to scroll across so i can find out what your problem is. Link to comment https://forums.phpfreaks.com/topic/73191-stinky-form/#findComment-369222 Share on other sites More sharing options...
Perfidus Posted October 14, 2007 Author Share Posted October 14, 2007 Well I'm sorry for that, I have never seen a marquee in a forum, this is what it saids: in the first case I get the 26'25 (25 + 5%) but in the following I get 25'25 !!!!! Link to comment https://forums.phpfreaks.com/topic/73191-stinky-form/#findComment-369230 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.