Cita:
Iniciado por xerifandtomas
Y cual es el error que te da exactamente? No termino de entenderte.
Hola xerifandtomas hasta ahora ningún error solo trato de que me salga un siclo en mi foreach y salga de esta forma.
UPDATE `inventario`.`registro` SET `unidades_r` = `unidades_r` - 1 WHERE ID_R = 5;
UPDATE `inventario`.`registro` SET `unidades_r` = `unidades_r` - 3 WHERE ID_R = 2;
UPDATE `inventario`.`registro` SET `unidades_r` = `unidades_r` - 7 WHERE ID_R = 3;
UPDATE `inventario`.`registro` SET `unidades_r` = `unidades_r` - 2 WHERE ID_R = 1;
porque yo recojo el ID y las unidades a restar gracias al foreach solo me faltaria agregar esa consulta a mi ciclo y que cada ID Y unidad a restar se le una me di a entender ?
![muerto de risa](http://static.forosdelweb.com/fdwtheme/images/smilies/biggrin.png)
![Confundido](http://static.forosdelweb.com/fdwtheme/images/smilies/confused.png)
espero me puedas ayudar porque ya estoy bloqueado