Ver Mensaje Individual
  #9 (permalink)  
Antiguo 02/10/2006, 12:13
Avatar de Erikfrancisco
Erikfrancisco
 
Fecha de Ingreso: noviembre-2003
Ubicación: Estado de México
Mensajes: 503
Antigüedad: 20 años, 5 meses
Puntos: 4
Si lo pones de esta forma:

Código PHP:
<?php 
$db 
mysql_pconnect "xxxx""xxxx""xxxx" );  
mysql_select_db 'xxxx' );  
$consulta "SELECT * FROM tblArticulos WHERE id_index IN ( $id2 )";  
$result mysql_query $consulta ); 
$numeroderesult mysql_num_rows $result );   

if (
$numeroderesult 0
{
   if ( isset ( 
$_POST['submit' ] ) )
   {
      while ( 
$fila mysql_fetch_array $result ) ) 
      {
         
$variable 'cantidad'.$fila['id_index'];
         if ( 
$_POST[$variable] <> $fila['cuotas'] )
         {
            echo 
"ID de artículo: ".$fila['id_index']."<br/>";   
            echo 
"Precio de artículo: ".$fila['precio']."<br/>";   
            echo 
"Cantidad de cuotas: ".$fila['cuotas']."<br/>";  
            echo 
"Total: ".$variable*$fila['precio']."<p>";
            continue;
         }
         else
         {
            echo 
"ID de artículo: ".$fila['id_index']."<br/>";   
            echo 
"Precio de artículo: ".$fila['precio']."<br/>";   
            echo 
"Cantidad de cuotas: ".$fila['cuotas']."<br/>";  
            echo 
"Total: ".$fila['cuotas']*$fila['precio']."<p>"
         }
      }
   }
   else 
   {
      echo 
"<form name = \"formu\" action = '".$_SERVER['PHP_SELFT']."' method = \"POST\">";
      while ( 
$fila mysql_fetch_array $result ) ) 
      {
          
         echo 
"ID de artículo: ".$fila['id_index']."<br/>";   
         echo 
"Precio de artículo: ".$fila['precio']."<br/>";   
         echo 
"Cantidad de cuotas: ".$fila['cuotas']."<br/>";  
         echo 
"Cantidad: <input type='text' name='cantidad".$fila['id_index']."' class='formulario' maxlength='30' value='1'><br/>"
         echo 
"Total: ".$fila['cuotas']*$fila['precio']."<p>"
      } 
      echo 
"<input type = \"submit\" name = \"submit\" value = \"Actualizar\">"
      echo 
"</form>"
   }

else 
{  
   echo 
"No hay resultados";  

?>
Funcionará? Suerte