I am doing a simple SELECT query on mysql, but want to know how to select every other entry from the database (alternate entries) ie rows 1, 3, 5, 7, etc not 1, 2, 3, 4...
Is there a mysql query for this? Or do I have to pick out alternate entries in my while loop (if so how do I do this?). The basic code I am using is below.
$query = "SELECT title FROM dvddetail
WHERE forswap='2' ORDER BY swapDateTime ASC
LIMIT 0, 10;";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$title = $row['title'];
echo $title;
}