These are the rows: This is my picture of whats in the rows:对于一个项目,我必须制作日历。日期和月份必须按照时间顺序排列,如名称:(DD-MM-YYYY)。现在我已经在html和php中创建了表格,但是我不知道如何对它进行排序。按日期顺序排列日期和月份php
<?php
$connection = new mysqli('localhost','root','','calendar');
$sql = "SELECT * FROM birthdays";
$result = $connection->query($sql);
$birthdayList = $result->fetch_all(MYSQLI_ASSOC);
?>
<!doctype html>
<html>
<head>
<title>Verjaardagskalender</title>
<link href="main.css" rel="stylesheet" type="text/css">
</head>
<body>
<table>
<?php
foreach($birthdayList as $birthdays){
?>
<tr>
<td><?php echo $birthdays['person'];?></td>
<td><?php echo $birthdays['day'];?></td>
<td><?php echo $birthdays['month'];?></td>
<td><?php echo $birthdays['year'];?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
你能告诉我一个例子,我必须把这行代码放在我的代码中吗? –
答复已更新。 –
我收到以下错误: 致命错误:调用第8行C:\ xampp \ htdocs \ calendar \ display.php中的布尔成员函数fetch_all() –