Mam problem z zapytaniem do bazy danych.
A mianowicie chcę zapisywać upomnienia użytkowników w bazie o takiej strukturze:
id_rebuke int(11) auto_increment
profile_rebuke text
link_profile_rebuke text
text_rebuke text
date_rebuke date
mod_rebuke text
link_post_rebuke text
i chcę stworzyć takie zapytanie by wyświetlały tylko te rekordy, których jest 5 takich samych wg pola profile_rebuke. Spróbuje wyjaśnić na przykładzie. Mamy takie rekordy:
1 | Janek | http://... | spam | 13.03.2008 | bemol | http://...
2 | Zbyszek | http://... | spam | 14.03.2008 | bemol | http://...
3 | Franek | http://... | spam | 11.02.2008 | bemol | http://...
4 | Janek | http://... | spam | 03.11.2000 | bemol | http://...
5 | Jacek | http://... | spam | 13.03.2008 | bemol | http://...
6 | Janek | http://... | spam | 13.03.2008 | bemol | http://...
7 | Janek | http://... | spam | 13.03.2008 | bemol | http://...
8 | Paweł | http://... | spam | 07.01.2007 | bemol | http://...
9 | Paweł | http://... | spam | 13.03.2008 | bemol | http://...
10 | Janek | http://... | spam | 13.03.2008 | bemol | http://...
11 | Paweł | http://... | spam | 22.02.2007 | bemol | http://...
I chcę, aby wybrało tylko rekordy, których jest 5 wg imienia. Czyli, aby wyświetliło mi dokładnie coś takiego:
5 upomnień zdobył/li:
while ...
$row['nick']