Logo Luan Morina
Select MySQL table rows with the current day and month
YearEvent
1787 Delaware becomes 1st state to ratify constitution
1842 NY Philharmonic's 1st concert
1912 George Darwin theorized moon was pulled out of Pacific Ocean dies
1935 Winnipeg Blue Bombers become 1st western team to win Grey Cup
1941 Pearl Harbor attacked (a day that will live in infamy) 1st Japanese submarine sunk by American ship (Ward)
1953 Israel's PM Ben-Gureon retires
1960 France grants Ivory Coast independence (National Day)
1972 Apollo 17 last of Apollo moon series launched
1975 10th Islander shut-out opponent - Glenn Resch 3-0 vs Sabres
1977 Islander Billy Smith's 10th shut-out opponent - Black Hawks 4-0
1978 Islander's Mike Bossy's 1st career hat trick
1979 Cecilia Payne-Gaposchkin 1st woman full prof at Harvard U dies

Query

SELECT * FROM today_in_history WHERE DAY(mcm_date)=DAY(NOW()) AND MONTH(mcm_date)=MONTH(NOW()) LIMIT 0, 60

Source code

$conn = new mysqli ("server", "user", "password", "database");
mysqli_set_charset ($conn, "utf8");
if ($conn -> connect_error) {
die ("Error: " . $conn->connect_error);
} 
$sql = "SELECT * FROM today_in_history WHERE DAY(mcm_date)=DAY(NOW()) AND MONTH(mcm_date)=MONTH(NOW()) LIMIT 0, 60";
$result = $conn -> query($sql);
echo "<table id='demoTable' class='table table-striped'>";
echo "<thead>";
echo "<tr>";
echo "<th>Year</th>";
echo "<th>Event</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>"; 
while ($row = $result -> fetch_assoc()) { 

$var_year = date_create($row["mcm_date"]);

echo "<tr>";
echo '<td>' . date_format($var_year, 'Y') . '</td>' . "\n";
echo "<td>" . $row["mcm_event"] . "</td>";
echo "</tr>";
}

echo "</tbody>";
echo "</table>";
$conn -> close();
?>
   Select table rows with the current day and month