我有以下代码。
<?php if ( $showdata['venue'] == "Brean Sands" ) {echo "<div class=\"gigpress-related-park\">"; echo $showdata['date_long']; echo $showdata['venue']; echo "</div>"; } ?>
<?php if ( $showdata['venue'] == "Camber Sands" ) {echo "<div class=\"gigpress-related-park\">"; echo $showdata['date_long']; echo $showdata['venue']; echo "</div>"; } ?>
<?php if ( $showdata['venue'] == "Pakefield" ) {echo "<div class=\"gigpress-related-park\">"; echo $showdata['date_long']; echo $showdata['venue']; echo "</div>"; } ?>
<?php if ( $showdata['venue'] == "Prestatyn Sands" ) {echo "<div class=\"gigpress-related-park\">"; echo $showdata['date_long']; echo $showdata['venue']; echo "</div>"; } ?>
<?php if ( $showdata['venue'] == "Southport" ) {echo "<div class=\"gigpress-related-park\">"; echo $showdata['date_long']; echo $showdata['venue']; echo "</div>"; } ?>
这可以很好地从我的数据库中提取信息,但我需要它循环或重复,以便为每个场地显示多个日期。db 中的每个场地都有多个日期,但正如代码所示,它只返回第一个日期的值。我需要其他人也出现。
如何在仅查看一个场地并提取所有日期然后结束时让此代码循环?