<ul class="items">
<li>
<span class = "item">
<?php
while ($row=mysqli_fetch_assoc($result))
{
foreach ($row as $key=>$val)
{
echo "{$val} " . " <br/>";
echo "<br /><hr /><br />";
}
}
mysqli_free_result($result); ?>
<a href="#" class="done-button">Mark as done</a>
</span>
</li>
</ul>
我试图将其添加到循环中:
href="#" class="done-button">Mark as done
aka - 用于待办事项列表的Mark as Done
按钮,以便它出现在每个输出的值旁边。但是,我只能在页面底部找到它。
答案 0 :(得分:0)
你关闭了!你需要做的就是移动循环内部的链接,就像这样(我不确定你想要按钮的确切位置):
<ul class="items">
<li>
<span class = "item">
<?php
while ($row=mysqli_fetch_assoc($result))
{
foreach ($row as $key=>$val)
{
echo "{$val} " . " <br/>";
echo "<br /><hr /><br />";
}
echo '<a href="#" class="done-button">Mark as done</a>';
}
mysqli_free_result($result); ?>
</span>
</li>
</ul>