php - How can I get the last row from a table mysqli? -


i have table , trying recent row using code:

include "db_conx.php";  $sql="select column table order desc limit 1";  if ($result=mysqli_query($db_conx,$sql))   {   while ($row=mysqli_fetch_row($result))   {   printf($row[0]);   }   mysqli_free_result($result); } 

it returns blank result though.

order desc limit 1 

order what desc? have provide column name want order by. auto increment column, primary key or timestamp etc

as stands query has invalid syntax , not return other error.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -