Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/03/2015, 02:00
Avatar de isaacanet
isaacanet
 
Fecha de Ingreso: febrero-2015
Mensajes: 15
Antigüedad: 9 años, 2 meses
Puntos: 0
Respuesta: verificar que el contador se dentenga en cero

Añade esto:
Código PHP:
<?php 
include("db.php"); 
$proid=$_POST['ITEM']; 

$sql ='select cantidad from productos WHERE id=$proid'

if(!
$sql){
die(
"Error: " mysql_error());
}



$res mysql_query($sql); 
$cantidadActual mysql_fetch_assoc($res);
$cantidadActual $cantidadActual["cantidad"];
if (
$cantidadActual == 0){ 
     
echo 
'No quedan' .$res['producto1''en inventario']; 

    } 
else { 

mysql_query("UPDATE productos SET cantidad = cantidad -1 WHERE id='$proid'"); 
header("location: tableedit.php#page=addproitem");  

?>
A ver si te aparece algún error.