How to use PHP display data of last insert row of a specific column
<p>I have a table in database with 2 columns, id(auto increment) and name.</p>

<pre><code>id|name
--|----
1 |John
2 |Jeff
3 |Jack 
</code></pre>

<p>I wish to show the last insert name in my webpage so I can <code>echo "The last person is $last_name";</code></p>

<p>I try retrieve the data by using following command, but it shows nothing.</p>

<pre><code>$last_name = mysqli_query($conn, 'SELECT name FROM namelist ORDER BY id DESC LIMIT 1')
</code></pre>

<p>Someone please help?
Thank you.</p>