Ver Mensaje Individual
  #5 (permalink)  
Antiguo 09/09/2008, 09:11
Avatar de Legoltaz
Legoltaz
 
Fecha de Ingreso: agosto-2008
Mensajes: 325
Antigüedad: 15 años, 8 meses
Puntos: 6
Respuesta: Ayuda con sistema de noticias php

Es como te ha comentado ElJavista.

index.php (donde están las noticias resumidas)

Código PHP:
<?
require('archivo_conexion.php');
$sql mysql_query("SELECT * FROM tu_tabla ORDER BY id DESC") or die(MySQL error'.mysql_error());
while($row = mysql_fetch_array($sql)){
echo "<h3><a href=noticias.php?id=".$row['
id'].">".$row['titulo']."</a></h3>".$row['resumen]."<hr />";
}
?>
noticias.php (donde se lee la noticia seleccionada entera)

Código PHP:
<?
if(!isset($_GET['id']) || empty($_GET['id'])){
header("location:index.php");
}
else{
require(
'archivo_conexion.php');
$query mysql_query("SELECT * FROM tu_tabla WHERE id = '$_GET[id]'") or die('MySQL error: '.mysql_error());
while(
$row mysql_fetch_array($query)){
echo 
"<h3>".$row['titulo']."</h3>".$row['noticia_completa'];
}
}
?>