Foro de elhacker.net

Programación => Desarrollo Web => Mensaje iniciado por: General Dmitry Vergadoski en 13 Febrero 2015, 18:42 pm



Título: duda con mostrar datos
Publicado por: General Dmitry Vergadoski en 13 Febrero 2015, 18:42 pm
 hola amigos aqui pongo un pedazo de mi codigo:
Código
  1.    <?php
  2.    if (isset($_POST['submit']))
  3.        {      
  4.        include 'db.php';
  5.  
  6.                        $Nombre=$_POST['Nombre'] ;
  7.                        $CI= $_POST['Idd'] ;                
  8.                        $Falla=$_POST['Falla'] ;
  9.                        $Estatus=$_POST['Estatus'] ;
  10.             mysql_query("ALTER TABLE servicio AUTO_INCREMENT=1");                                    
  11.             mysql_query("INSERT INTO `servicio`(Nombre,Idd,Falla,Estatus)
  12.             VALUES ('$Nombre','$Idd','$Falla','$Estatus')");
  13.  
  14.  
  15.                }
  16.    ?>
  17.  
  18.  
  19.                <?php
  20.                include("db.php");
  21.  
  22.  
  23.                $result=mysql_query("SELECT * FROM servicio");
  24.  
  25.                while($test = mysql_fetch_array($result))
  26.                {
  27.                    $id = $test['id'];
  28.                    echo "<tr align='center'>";
  29.                    echo"<td><font color='black'>" .$test['id']."</font></td>";
  30.                    echo"<td><font color='black'>" .$test['Nombre']."</font></td>";
  31.                    echo"<td><font color='black'>". $test['Idd']. "</font></td>";
  32.                    echo"<td><font color='black'>". $test['Falla']. "</font></td>";
  33.                    echo"<td><font color='black'>". $test['Estatus']. "</font></td>";  
  34.                    echo"<td> <a href ='view.php?id=$id'><strong>Editar</strong></a>";
  35.                    echo"<td> <a href ='del.php?id=$id'><strong>Eliminar<strong></a>";
  36.  
  37.                    echo "</tr>";
  38.                }
  39.                mysql_close($conn);
  40.                ?>
muchas gracias de antemano.