我有一个像这样的查询:
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;
}
请指教。