我有一个表,我试图让使用此代码的最新行:如何从表mysqli获取最后一行?
include "db_conx.php";
$sql="SELECT column FROM table ORDER BY DESC LIMIT 1";
if ($result=mysqli_query($db_conx,$sql))
{
while ($row=mysqli_fetch_row($result))
{
printf($row[0]);
}
mysqli_free_result($result);
}
它虽然返回一个空的结果。
是否有表中的任何主要ID时间戳? – mitkosoft
'$ sql =“从列表中选择列ORDER BY id DESC LIMIT 1”;'其中'id'必须是'主键' –
没有。但是我删除了。 – joeytrumann