How can I select the second and the last item in a MySQL table with php.
I tried to do the following but limited myself to position 12 of 15, and must show me from position 2 to 14 of 15 in total, the second and the penultimate item.
The idea is that if more positions are added, the penultimate will always be shown, in case a new one is added 16 and the penultimate would already be 15. and so with each new record.
My query
$query_paradas = "SELECT pos, r_lat, r_lng FROM escolar WHERE
placa='$placa_id' AND r_ruta='$ruta' AND jornada='$jornada' AND
estado='activado' AND pos BETWEEN 2 and 12 ORDER BY pos ASC";
$paradas = mysqli_query( $con, $query_paradas );
Thank you very much for the help