Mysql How To Select Display Last Row Item Retrieve Query SQL From Database Post Description:
Post Tags: mysql, how, to, select, display, last, row, item, retrieve, query, sql, from, database, mysql database, support, help, answers, questions, help This Post Has Been Viewed 3483 Times Since Fri Apr 27, 2007 3:13 pm Posted By hostman with 3 replies
Mysql How To Select Display Last Row Item Retrieve Query SQL From Database
this Returns the last row from a select where multiple rows in a database table. for example, lets say i have a table called users, and i want to get the last user who registered with the userid as the row. i could use this mysql query:
Code/Command:
$qry = "SELECT * FROM users ORDER BY userid DESC LIMIT 1";
?>
related questions:
How to find last row and last column of table
Retrieving last row inserted
How to select the Last row from a table..using Mysql - MySQL
How to retrieve the last row in MYSQL database using SELECT
Leave Your Comments
Share
URL:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites
Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
Comments and replies About Mysql How To Select Display Last Row Item Retrieve Query SQL From Database
:: 1 :: Reply #52369 Reply By hmm On Thu May 01, 2008 4:52 pm
eee..
but.. how to display 10 last comment ?
:: 2 :: Reply #75111 Reply By fernand On Sun Oct 12, 2008 9:39 am
thank you i needed help in using queries to get the last row in a database
:: 3 :: Reply #75115 Reply By wallpaperama On Sun Oct 12, 2008 9:43 am
if you want to select the last 10 rows for example you would use this query:
$sql = "SELECT this FROM users ORDER BY userid DESC LIMIT 0,10";
however, if you want to look for the first 10 rows of userid then you would just change the ORDER to ASC (ascending) like this:
$sql = "SELECT this FROM users ORDER BY userid ASC LIMIT 0,10";
if you have more questions about this tutorial let me know. i am very knowledgable with mysql