I need to select certain the rows from a table but need to show only just five of them.
For example
select * from table where user = $user;
but i need only top five results
litlemaster
0
Light Poster
Recommended Answers
Jump to PostLook at the mysql online documentation w.r.t. LIMIT.
Jump to Post$results = mysql_query("SELECT * FROM bookmarks WHERE user_name = '$userStr' ORDER BY date_time DESC LIMIT 5");
All 5 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.