Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/11/2005, 16:12
Avatar de lrunge
lrunge
 
Fecha de Ingreso: agosto-2005
Ubicación: En algun lugar de Caracas
Mensajes: 165
Antigüedad: 18 años, 8 meses
Puntos: 4
Mostrar un registro de forma aleatoria

La cuestion es sencilla, tengo esta pagina que me muestra todos los registros de la BD en Mysql.


Código PHP:
<HTML>
<HEAD>
<TITLE>lectura.php</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<h1><div align="center"></div>
</h1>
<br>
<br>
<?
mysql_connect
("localhost","user","pass");

$result=mysql_db_query("mibasededatos","select * from tabla");
?>
<table border="1" align="center">
<?
while ($row=mysql_fetch_array($result))
{
echo 
'<tr><td width="60">'.$row["id"].'</td>';
echo 
'<td width="734">'.$row["pregunta"].'</td>';
}
mysql_free_result($result)
?>
</table>

<div align="center">
  <p><a href="index.php">Añadir un nuevo registro</a><br>
</p>
</div>

</BODY>
</HTML>
Como hago para mostrar un solo registro, PERO DE MANERA ALEATORIA?

Que cuando abra la pagina, me muestre el registro nº 2, luego cuando la cargue otra vez, me muestre el 18, y luego el 6, 13, 37 ....... N, pero que solo muestre uno UN REGISTRO

Alguien me podria ayudar???

Gracias a todos y saludos.