SELECT * FROM `types` WHERE `userid` = ".$obstawianie_wyniki['id']." ORDER BY `date` ASC
Jednak `date` to data dodania wpisu, a nie meczu. A chciałbym aby sortowało się wg. daty meczu.
Próbowałem tak:
SELECT * FROM `types` WHERE `userid` = 17 ORDER BY (SELECT `date` FROM `matches` WHERE `id` = matchid) ASC
Tabela: matches
id date ateam bteam aresult bresult agroup bgroup type
Tabela: types
id userid matchid atype btype date points