我正在尝试将内容(从我的数据库中)加载到不同年份的页面中。
$yearQuery = mysql_query("SELECT DISTINCT YEAR(startDate) AS year FROM series ORDER BY startDate DESC");
if(mysql_num_rows($yearQuery) > 0) {
while($year = mysql_fetch_assoc($yearQuery)) {
echo "<li><a href='/teaching/podcasts?year=".$year['year']."'>".$year['year']."</a></li>";
}
}
else {
echo "<li>".mysql_error()."</li>";
}
我设法让这个成功地工作:
while($yearSeries = mysql_fetch_assoc($yearSeriesQ)) {
echo "<div class='prevSermon'>";
echo "<div class='prevImage'>";
echo "<a href='/teaching/podcasts?id=".$yearSeries['id']."'><img height='90' width='90' alt='".$yearSeries['title']."' src='/admin/".$yearSeries['image']."'/></a>";
echo "</div>";
echo $yearSeries['title'];
echo "</div>";
}
它显示了上一个系列中的几周。
这些年来我做错了什么,一个是右下角的档案?