Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/11/2003, 07:31
Beldar
 
Fecha de Ingreso: julio-2002
Mensajes: 40
Antigüedad: 21 años, 8 meses
Puntos: 0
Gestor de noticias

Hola estoy desarrollando un gestor de noticias con php y mysql. Este es el codigo ke me permite insertar las noticias y mostrarlas en una misma pagina:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Añadir noticias</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<form action="procesar.php" method="get">
<tr>
<td width="67">Title:</td>
<td width="433"><input type="text" name="title"></td>
</tr>
<tr>
<td>Short text : </td>
<td><textarea name="shorttxt" cols="100" rows="5"></textarea></td>
</tr>
<tr>
<td>Long text : </td>
<td><textarea name="longtxt" cols="100" rows="10"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="accion" value="grabar">
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</form>
</table>
<?php
include("conex.php");
$link=Conectarse();
$result=mysql_query("select * from new",$link);
?>
<?php

while ($row = mysql_fetch_array($result)) {
printf("<table width=750 border=0 cellspacing=0 cellpadding=0 align=center>
<tr>
<td><b>%s</b></td>
</tr>
<tr>
<td>%s</td>
</tr>
<tr>
<td>%s</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>", $row["title"], $row["shorttxt"], $row["longtxt"]);
}
mysql_free_result($result);
mysql_close($link);
?>
</body>
</html>

Me gustaria saber como puedo hacer para insertar una variable numerica ke indike cuantas noticias deben mostrarse. Otra cosa ke me gustaria saber es como ordenar las noticias al reves, kiero decir, ahora tal como las inserto se muestran, pero lo logico es ke las ultimas noticias a parezcan encima de las noticias de ayer. Alguien puede ayudarme con estas dos cosas?