Ver Mensaje Individual
  #14 (permalink)  
Antiguo 29/05/2011, 16:41
eresvey
 
Fecha de Ingreso: febrero-2011
Ubicación: cali, valle del cauca
Mensajes: 158
Antigüedad: 13 años, 2 meses
Puntos: 8
Respuesta: Problema con condicional!

ok, miremos el codigo estare probando pero si alguiens ave, me ayudaria mucho:
Código PHP:
Ver original
  1. <?
  2. include_once("conectar.php");
  3. $conn=BD::Conectar();
  4. $tienda=$_POST["tienda"];
  5. $cantidad=$_POST["cantidad"];
  6. $r=mysql_query("SELECT * FROM tb_producto WHERE id_producto='$co'",$conn);
  7. ?>
  8.  
  9.  
  10. <?php
  11.  
  12. while($f=mysql_fetch_array($r))
  13. {
  14. $sd=$_POST["cantidad"];
  15.  
  16. if($sd  > $f["existencia"])
  17. {
  18. echo '<center><br>
  19.  
  20.  
  21. <font face=arial color=red>! Exedites la existencia del producto, por favor elije una existencia menor a '.$f["existencia"].'!</font></br></center><center><img src="http://www.forosdelweb.com/free_berries/free_mobile_berries_64/stop_64.png" width="64" height="64" /></center>
  22. <center><font face=arial color=red>!Compra aplazada!</font></center>';
  23.  
  24. }else{
  25. $precio=$f["precio"];
  26.   $edi=$cantidad*$precio;
  27.   $edi = number_format($edi, 0, ',', '.');
  28.   $valor=$f["precio"];
  29.   $valor = number_format($valor, 0, ',', '.');
  30.   $as=$f["nom_producto"];
  31. echo '<table width="819" height="117" border="0">
  32.    <tr>
  33.      <th width="400" height="21" scope="col"><div align="left" class="style12">Producto:</div></th>
  34.      <td><font face="arial" color="black" size="2">'.$f["nom_producto"].'</font></td>
  35.    </tr>
  36.    <tr>
  37.      <td height="21"><span class="style12">Descripcion:</span></td>
  38.      <td><font face="arial" color="black" size="2">'.$f["des_producto"].'</font></td>
  39.    </tr>
  40.    <tr>
  41.      <td height="21"><span class="style12">Precio:</span></td>
  42.      <td><font face="arial" color="red" size="3"><u>$'.$valor.'</u></font></td>
  43.    </tr>
  44.    <tr>
  45.      <td height="21"><span class="style12">Cantidad:</span></td>
  46.      <td><font face="arial" color="black" size="2">'.$cantidad.'</font></td>
  47.    </tr>
  48.    <tr>
  49.  
  50.    </tr>
  51.  </table>'
  52.  
  53.   ;}
  54.  
  55. }
  56. mysql_close($conn);
  57. ?>