返回我有这样一个查询:找到阵列的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