Well, I have the following code:
function dameTodosLosProyectos( $con, $cantidad = 0 )
{
if( $cantidad > 0 )
{
$query = "SELECT * FROM proyectos LIMIT $cantidad";
}else
{
$query = "SELECT * FROM proyectos";
}
return mysqli_query($con, $query);
}
With him I can put so much:
$result = dameTodosLosProyectos($link, 3); //Seleccionar primeras 3 filas
$result = dameTodosLosProyectos($link); //Seleccionar todas las filas
Now, my question is:
- How do I select three rows but not the first three but the last three or starting with the second (that is, the 2,3 and 4)?
- How do I select for example rows 2 and 3, to print them with a certain CSS, and then take the 4 and apply another code, etc.?