![](/img/trans.png)
[英]How can I create a value from two other values in the same table in my SQL?
[英]How can I display an amount of units in my table with the same value?
您好,我正在制作带有标记的Web应用程序。 我想在导航中显示一种通知圈,其中有一个数字,其中约会的数量显示在地图上。 在我的数据库中,它们的值为0(未完成)和1(已完成)。 该值显示在状态下方的图像中。 我想在div中显示值为0的约会数量。 我不知道如何。
这是我的主文件中的代码(带有导航):
<ul>
<li>
<a class="navi current-page" href="main.php"><i class="ion-map icons"></i>Kaart<div class="rondje"><?php include'notifications.php'; ?></div></a>
</li>
<li><a class="navi" href="overzicht.php"><i class="ion-ios-list icons"></i>Overzicht</a></li>
<li><a class="navi" href="instructie.html"><i class="ion-help-circled icons"></i>Handleiding</a></li>
<li><a class="navi" href="index.html" onclick="return confirm('Ben je zeker dat je wilt uitloggen?')"><i class="ion-log-out icons"></i>Log uit</a></li>
</ul>
这就是我以为它将在php中:
while ($markers = mysql_fetch_assoc($records)) {
echo "<p>";
echo $markers['status'];
echo "</p>";
}
我发现了一些对自己有用的东西。
<?php
$query="SELECT COUNT(*) FROM markers WHERE Status=0 AND DATE (dag) = CURDATE()";
$results = mysql_query($query);
while ($row = mysql_fetch_array($results)) {
echo '<div class="rondje">';
foreach($row as $field) {
echo '<p>' . htmlspecialchars($field) . '</p>';
}
echo '</div>';
}
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.