这是可行的,但是有没有更短(更有效)的方法来做到这一点?代码比较 2 个数字。一条是从最近的记录开始,另一条是从 7 条记录开始。
$sql5="SELECT market_cap_rank FROM intelligence WHERE id='$thiscoin' order by day desc limit 0,1";
$row5 = mysqli_fetch_row(mysqli_query($conn, $sql5));
$newest = $row5[0];
$sql6="SELECT market_cap_rank FROM intelligence WHERE id='$thiscoin' order by day desc limit 6,1";
$row6 = mysqli_fetch_row(mysqli_query($conn, $sql6));
$oldest = $row6[0];
$rankdiff=$oldest-$newest;
慕森卡