Hello i want to select from database looks like this (id, nickname)
id is unique and nickname can be input many times, i select rows from base something like this
PHP Code:
select from my_table order by id desc limit 0,20
start of limit changing by the page.
But now i want to change row select. I want to select 20 rows but with condition that withdraw only 4 rows for one nick per page (per 20 rows).
I don't understand how can i make it.
10-16-2011, 12:05 AM
nickosmon
Mmm, do you mind re phrasing your post? I don't understand what you need done.
10-16-2011, 03:12 AM
ijs
i have a column "nickname" and i need to make a query which will withdraw 20 rows, in this query i need to withdraw only 4 rows per one nickname(or lower than 4 rows by 1 nickname)
$result = mysql_query ($sql) while $somerow= mysql_fetch_assoc($result){ $nick = $somerow['nickname'];
$sql2 = "SELECT id,nickname FROM mytable WHERE nickname = '" . $nick. "' ORDER BY id ASC LIMIT 4; $result2 = mysql_query($sql2); while $myrow = mysql_fetch_assoc($result2){