返回我有這樣一個查詢:找到陣列的while循環最小值從MySQL查詢
select * from posts p where p.post like '%cadillac%' ORDER BY p.upvotes DESC,
p.unix_timestamp DESC LIMIT 20
現在,同時通過陣列循環,我需要找到最小unix_timestamp
值。例如:
$counter = 0;
while($row = $result->fetch_assoc()){
// what do i do here to find the minimum timestamp value
$counter = $counter + 1;
}
請指教。
這聽起來很簡單,也許我沒有得到題吧...店檢查變量中的unix_timestamp值,並檢查當前行的值是否較小,如果是,則將該值保存在變量中。 – Eggplant 2013-03-25 17:37:14
爲什麼如果我可能會問這個投票呢? – coder101 2013-03-25 17:47:12