I have a 'News' section where novelties are read from a table in the database. The page shows only the first 5, in this way:
<?PHP
$i = 1;
$SQL_NEWS=" SELECT titulo, copete, cuerpo, imagen, id FROM novedad ORDER BY
orden desc LIMIT 3";
$QUERY_NEWS=mysql_query($SQL_NEWS);
WHILE($NEWS = mysql_fetch_row($QUERY_NEWS)){
?>
<div class="col-sm-3 notaHome">
<!--Directorio de imagenes cargadas en bdd. Puede cambiar. En la tabla esta solo el nombre de img-->
<img src="/img3/<?php echo $NEWS[3] ?>" class="img-thumbnail" alt="">
<!--Titulo-->
<h4 class="azul tituloNota"><?php echo htmlentities(mb_strtoupper($NEWS[0])) ?></h4>
<hr class="azul">
<!--Subtitulo-->
<h5 class="subtituloPrincipal subtituloNota"><?php echo htmlentities($NEWS[1]) ?>.</h5>
<!--Copete-->
<p>
<?php echo $NEWS[2] ?>
</p>
<a href="template-novedades.php?id=<?php echo htmlentities($NEWS[4]) ?>"
id="leerMas" role="button" name="bot_cuerpo_<?php echo
htmlentities($NEWS[4]) ?>" class="btn btn-primary">SEGUIR LEYENDO <span
class="glyphicon glyphicon-chevron-right"></span></a>
</div>
<?php
$i++;
}
?>
The problem is that then you have to add a 'load more' button where you load up to 5 more records each time until there are no more new features in the table, and I do not know how the query would be to do that, or that I should put the button. Thanks!