1.- Como hago para que la instruccion me muestre solo 2 registros, tomandolos de la base de datos en donde hay un campo que se llama ID, solo quiero los ultimos 2 registros, pero cuando ejecuto mi website me muestra todos.
2.- Alguien conoce alguna instruccion o codigo simple para colocarle un boton de siguiente y muestre los demas registros.
Mil gracias por la ayuda. El codigo que utilizo para mostrar los valores es :
Tomando en cuenta que .$row[titletext]. es el campo de la introduccion de la noticia.
Cita:
<?
$connect=mysql_connect("localhost","root","soltecn a");
mysql_select_db("noticias",$connect);
$result=mysql_query("select * from noticias_news order by id Desc",$connect);
echo '<p>ÚLTIMAS NOTICIAS</p><br>';
while($row=mysql_fetch_array($result)) {
echo '<table>
<tr>
<td >'.$row[titletext].'<br><a href="noticias/noticia.php" target="_self">Leer mas...</a>
</td>
</tr>
</table>
<br>';}
?>
$connect=mysql_connect("localhost","root","soltecn a");
mysql_select_db("noticias",$connect);
$result=mysql_query("select * from noticias_news order by id Desc",$connect);
echo '<p>ÚLTIMAS NOTICIAS</p><br>';
while($row=mysql_fetch_array($result)) {
echo '<table>
<tr>
<td >'.$row[titletext].'<br><a href="noticias/noticia.php" target="_self">Leer mas...</a>
</td>
</tr>
</table>
<br>';}
?>