anonīms Posted October 20, 2009 Report Share Posted October 20, 2009 Izvada * test - 2009-10-21 01:20 * test - 2009-10-21 01:20 * kas - 2009-10-21 01:17 * kas - 2009-10-21 01:17 * adada - 2009-10-21 01:16 test, kas, adada ir foruma tematu nosaukumi. Izvelku ar mysql_query("SELECT * FROM ".PREFIX."forums_atbildes ORDER BY datums DESC LIMIT 5"); bet nepieciešams, lai būtu * test - 2009-10-21 01:20 * kas - 2009-10-21 01:17 * adada - 2009-10-21 01:16 mēģināju šādi: mysql_query("SELECT DISTINCT temats FROM ".PREFIX."forums_atbildes ORDER BY datums DESC LIMIT 5"); bet viņš nesarindo pēc datuma.. struktura ir tāda pati kā ipb forumiem.. pamatkods: http://paste.php.lv/19bf41ef0d8e30c27d5665e9520304e9?lang=php -- Ko lai dara? Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted October 21, 2009 Report Share Posted October 21, 2009 SELECT DISTINCT temats, max(datums) AS datums_max FROM ".PREFIX."forums_atbildes GROUP BY temats ORDER BY datums_max DESC LIMIT 5 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.