Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/09/2006, 19:21
Avatar de FuLaNo_
FuLaNo_
 
Fecha de Ingreso: mayo-2003
Ubicación: Don Torcuato, Buenos Aires, Argentina
Mensajes: 1.250
Antigüedad: 21 años
Puntos: 2
Exactamente es como piensas, por ejemplo, en el home tienes

Código PHP:
<?php
$sql 
mysql_query("SELECT `title`, `id` FROM `news` ORDER BY `id` DESC LIMIT 0,10");
while(
$row mysql_fetch_assoc($sql)) {
  echo 
'<a href="noticia.php?id='.$_row[id].'">'.$row['title'].'</a><br />';
}
mysql_free_result($sql);
?>
Ahora en noticias.php haces esto:

Código PHP:
<?php
$sql 
mysql_query("SELECT * FROM `news` WHERE `id` = '$_GET[id]'");
if (
$row mysql_fetch_assoc($sql)) {
  echo 
'
    <h1>'
.$row['title'].'</h1>
    <h4>'
.$row['text'].'</h3>
  '
;
}
mysql_free_result($sql);
?>
__________________
I Love Programming...