當圖像上傳到網站時,我想顯示它在圖片下上傳的月份。我在數據庫中有一個時間戳字段。如果可能的話,我可以從時間戳中得到月份嗎?我該怎麼做?
如果可能的話,我可以從時間戳中得到月份嗎?我該怎麼做?
我嘗試使用此代碼
<?php $query="SELECT * FROM magimgdes ORDER BY id DESC, time DESC " ;
$result=mysql_query($query) OR DIE(mysql_error());
while($row=mysql_fetch_array($result)){
$value1=$row['image'];
$value3=$row['time'];
?>
<img src="admin/upload/hompageimage/<?php echo $value1; ?>" width="180" height="195" alt="magimage" />
<?php echo $value3;} ?></div>
「時間」字段是在數據庫中的時間戳字段來做到這一點。
我只想回顯月份。
數據庫中的「時間戳」字段不明確。什麼是列類型?或者你指的是UNIX時間戳? – nickb
我編輯了問題 – piumi
print'$ row ['time']'看起來像什麼? – Baba