My code goes like this,
$sql = "SELECT Month(time) as Month, Year(time) as Year,
title, COUNT(*) AS total FROM posts GROUP BY Year, Month ORDER BY time DESC";
$stmt = $conn->query($sql);
if ($stmt->num_rows > 0) {
while($row = $stmt->fetch_array()){
echo "<div class=title>" . $row["title"]. "</div>";
}
}
it is supposed to output 4 titles,
Bellavisa
Mist Neting
Turkey is cool!
Cock of the Rock
but it only outputs
Bellavisa
Turkey is cool!
Cock of the Rock
Note that bellavisa and mist neting are in the same year and month, (setting up an archive list)
EDIT
Here is some of the table data
title "bellavisa" content "yadadada" time "timestamp ..." Author "author"
title "mist nesting" content "yadadada" time "timestamp ..." Author "author"