Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/12/2008, 11:15
Avatar de pablosky13
pablosky13
 
Fecha de Ingreso: septiembre-2008
Mensajes: 42
Antigüedad: 15 años, 7 meses
Puntos: 0
Pregunta Respuesta: Eliminar registro

Muchas Gracias Ozkar_86, pero no me sirvió 100% ya que no supe que elementos reemplazar, pero si me ayudo a entender que hacer y llegue a este código el cual me aparece el botón eliminar, pero no cumple su función :S.
No se que hacer
Código PHP:
<?php
$conexion 
mysql_connect('localhost''pablo''pablo');
mysql_select_db('auto concept club');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
$queEmp 
"SELECT * FROM noticias ORDER BY fecha DESC";
$resEmp mysql_query($queEmp$conexion) or die(mysql_error());
$totEmp mysql_num_rows($resEmp);

$btn_eliminar="<a href=tabla_noticias.php?eliminar=1>Eliminar</a>";

while (
$registro mysql_fetch_array($resEmp)) {

$ID=$registro['idnoticias'];

if (
eliminar==1)
$sSQL "Delete From noticias Where idnoticias = '$ID'"
?>
<div id="tabla">
  <table width="410" border="0" cellpadding="1" cellspacing="4" bordercolor="#000000">
    <tr>
      <td width="35%" class="Estilo4"><?php echo $registro['fecha']; ?></td>
      <td width="26%">&nbsp;</td>
      <td width="20%">&nbsp;</td>
      <td width="19%">&nbsp;</td>
    </tr>
    <tr>
      <td class="Estilo1"><?php echo $registro['titulo']; ?></td>
      <td class="Estilo4"><?php echo $registro['zona']; ?></td>
      <td class="Estilo7"><div align="center">Modificar</div></td>
      <td class="Estilo7"><? echo $btn_eliminar ?></td>
    </tr>
    <tr>
      <td colspan="4" class="Estilo2"><?php echo $registro['noticia_completa']; ?></td>
    </tr>
<?php
}
mysql_free_result($resEmp);
mysql_close($conexion);
?>
</table>
</div>
</body>
</html>
Gracias de todos modos

PD: tengo 23 años y llevo 5 meses aprendiendo php, se que no es difícil, pero hay cosas que ni se me ocurre como hacer, jajajajajajj, por eso recuro a este foro.


Siempre hay alguien que sabe mas que uno.