You need to order results and set a limit.
Assuming date-time is what you wanted to order:
$query = "
SELECT
lat,
lng,
DATE_FORMAT(datetime,'%W %M %D, %Y %T') AS datetime
FROM markers1 WHERE 1
ORDER BY datetime DESC
LIMIT 5
";
EDIT:
To respond to OP's comment: “the result I get begins with row Row 50 for the first request, and follows 49,48,47,46. Is it possible that I can get this start on line 46,47, 48.49.50? "
PHP, . , mysql .
SQL-, :
$query = "
SELECT
lat,
lng,
DATE_FORMAT(datetime,'%W %M %D, %Y %T') AS datetime
FROM (
SELECT
lat,
lng,
datetime
FROM markers1 WHERE 1
ORDER BY datetime DESC
LIMIT 5
) AS tmp_markers
ORDER BY datetime ASC
";
, . DATE_FORMAT , datetime.