From: Pedro Pablo Vivanco del Rio
(
webmaster .en. todoalbo.cl)
Date: Sat Mar 06 2004 - 02:05:39 CET
Hola:
Escribo en la Mailing List para
preguntar si alguien me puede ayudar con lo siguente:
Estoy creando un sistema de noticias en PHP y de verdad que
me ha costado demasiado!! y este es el codigo que tengo en la
primera pagina:
<HTML>
<HEAD>
<TITLE>lectura.php</TITLE>
</HEAD>
<BODY>
<h1><div align="center">Lectura de la
tabla</div></h1>
<br>
<br>
<?
//Conexion con la base
mysql_connect("localhost","user","xxxx");
//Ejecutamos la sentencia SQL
$result=mysql_db_query("noticias","select * from noticias
ORDER BY id DESC");
?>
<table width="411" border="0" cellpadding="0"
cellspacing="0">
<tr>
<?
//Mostramos los registros
while ($row=mysql_fetch_array($result))
{
echo '<td width=161 height=130><img
src='.$row["imagen"].' border=0></td>';
echo '<td
width=250>'.$row["titulo"].'<br><br>'.$row["chica"].'
</td></tr>';
echo '<tr>';
echo '<td height=0 colspan=2><a
href=noticias2.php?id='.$row["id"].'>Mostrar</a></td>';
echo '</tr>';
}
mysql_free_result($result)
?>
</table>
<div align="center">
<a href="mandar.htm">Añadir un nuevo
registro</a><br>
</div>
</BODY>
</HTML>
y luego en otra tengo el siguente para ver la noticia
completa:
<?
//Conexion con la base
mysql_connect("localhost","user","xxxx");
?>
<?php
$selec = mysql_query("SELECT * FROM noticias ORDER BY id
DESC");
while ($row = mysql_fetch_array($selec)) {
echo "<table width=\"34%\" border=\"1\"
cellspacing=\"0\"
cellpadding=\"0\">
<tr>
<td>$row[titulo]</td>
</tr>
<tr>
<td><img
src=\"$row[imagen]\"></td>
</tr>
<tr>
<td>$row[noticia]</td>
</tr>
</table><br>";
}
?>
pero no se como configurar el php para que solo se me habra
la noticia que selecciono en el segundo archivo...alguien me
puede ayudar?? y como configurar el primero para poner un
cierto numero de noticiaaaas.
Atte,
Pedro Pablo Vivanco del Rio -
--www.todoalbo.cl---
pedropablo .en. todoalbo.cl
This archive was generated by hypermail 2.1.7 : Fri May 14 2004 - 16:04:34 CEST