如何從mysql數據庫中像(00:00)那樣只顯示小時和分鐘? 這裏是我的代碼:如何只顯示小時和分鐘從PHP數據庫像PHP(00:00)?
$query = "SELECT * FROM table";
$resualt = mysqli_query($conn, $query);
if (mysqli_num_rows($resualt) > 0)
{
echo "<table class='tb'>";
while($row = mysqli_fetch_assoc($resualt)){
echo "<tr><td>" . $row['id']. "</td><td> " .$row['name']. " </td><td> " . $row['place']. " </td><td> " . $row['ddate']. " </td><td> " . $row['dtime']. " </td><td> ".$row['message']."</td></tr>";
}
echo `enter code here`"<table>";
}
else
{
echo "there is no record.";
}
感謝
的[在PHP中的日期時間獲取年/月/日?(可能的複製http://stackoverflow.com /問題/ 7247259 /獲得個e-year-month-from-datetime-in-php) –
這是指「dtime」列嗎?該列中的示例值是什麼? –
dtime專欄顯示我這個:02:01:00.0但我想告訴我02:00 hh:mm只在瀏覽器 – buuhoodle