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

Member Avatar

diafol

Look at the mysql online documentation w.r.t. LIMIT.

its not working:
$getreplies="Select * from bookmarks LIMIT 0, 5 where user_name in ('$userStr') order by date_time desc LIMIT 0, 5"; //getting replies

Member Avatar

diafol

$results = mysql_query("SELECT * FROM bookmarks WHERE user_name = '$userStr' ORDER BY date_time DESC LIMIT 5");

oh i am sorry,
i solved it
i had applied limits twice