PHP - Listar en un Formulario los datos de una tabla donde se pueda editar y eliminar.

 
Vista:
sin imagen de perfil

Listar en un Formulario los datos de una tabla donde se pueda editar y eliminar.

Publicado por Eli (1 intervención) el 17/10/2016 17:26:45
Hola Buen Día a todos.
Compañeros estoy empezando en esto de la programación, y tengo una dificultad ya que debo de mostrar las personas que estén registradas en una tabla aun formulario, y que de ahí se pueda editar y eliminar.

Les comparto el código que llevo pero no se que mas hacer o si voy bien.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
require "ConexionDatos.php";
$objConexion=Conectarse();
$sql="select MedIdentificacion, MedNombres, MedApellidos FROM medicos";
$resultado = $objConexion->query($sql);
?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
 
<body>
<form id="form1" name="form1" method="post" action="">
  <div align="center">
    <table width="200" border="1">
      <tr>
        <h1 align="center">LISTAR MÉDICOS </h1>
        <table width="89%" border="0" align="center">
          <tr align="center" bgcolor="#FFFF99"> </tr>
          <tr>
            <td bgcolor="#FFFF33">Identificaci&oacute;n</td>
            <td bgcolor="#FFFF33">Nombres</td>
            <td bgcolor="#FFFF33">Apellidos</td>
            <td bgcolor="#FFFF33">Editar</td>
            <td bgcolor="#FFFF33">Eliminar</td>
          </tr>
  <td align="center">&nbsp;</td>
 
      <td align="center">&nbsp;</td>
  </tr>
 
  <tr>
      if($medico = $resultado->fetch_object()){
   <td> <?php echo $medico->MedIdentificacion; ?>     </td>
    <td>   <?php echo $medico->MedNombres; ?>       </td>
    <td>  <?php echo $medico->MedApellidos ;?>   </td>
 
 
 
   <td align="center"><a href="frmAgregarMedico.php?MedIdentificacion=<?php echo $medico->Medidentificacion?>"><img src="Imagenes/editar.jpg"
 
         width="29" height="24" /></a></td>
 
    <td align="center"><a href="eliminarEmpleado.php?idEmpleado=<?php echo $empleado->idEmpleado?>"><img src="Imagenes/eliminar.png"
 
        width="29" height="24" /></a></td>
		}
  </tr>
        </table>
        </div>
</form>
 
</body>
</html>


Formulario
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder