Search found 38 matches

by Smasher
Mon Nov 05, 2007 5:08 pm
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

PHP version 5.2.3 / MySQL version 4.1.22-standard I don't know what your refering to with ANSI. The error I recieve is "Invalid use of group function" via a script/phpmyadmin sql query. The exact query is; SELECT p.`id`, t.`title`, MAX(p.`updated`) FROM `Thread` t INNER JOIN `Post` p ON (t...
by Smasher
Thu Oct 25, 2007 11:08 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

MySQL said: Documentation
#1111 - Invalid use of group function
by Smasher
Thu Oct 25, 2007 10:18 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

I get

Invalid use of group function

:(
by Smasher
Thu Oct 25, 2007 5:07 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

A list of threads ordered by the last post.
by Smasher
Thu Oct 25, 2007 4:09 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

Nope, sorry - maybe I didn't explain properly.

The order should be by the last post - even the thread result should be ordered by the last post.

So the last thread posted in is at the top of the list.
by Smasher
Thu Oct 25, 2007 3:24 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

Unfortunately that makes no difference, still order by the thread id.

Also, it seems to me that isnt using the last post time and is relying on an id to order it.
by Smasher
Wed Oct 24, 2007 4:54 pm
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

Bumpen :)
by Smasher
Thu Oct 11, 2007 4:43 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

Did anyone look into this? I could provide some code if it'd help test.
by Smasher
Sat Oct 06, 2007 3:53 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

http://wuggawoo.co.uk/betaForum/?page=f ... =view&id=3

At the moment it orders by the id asc or desc *depending whats put at the end of the query* whereas it should order by the last post.
by Smasher
Fri Oct 05, 2007 4:04 pm
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] [quote=&q...
by Smasher
Fri Oct 05, 2007 3:39 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

hmm it still ordered by the thread id :/
by Smasher
Tue Oct 02, 2007 5:09 pm
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

Do you have an advise on how todo it right?
by Smasher
Mon Oct 01, 2007 4:20 am
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

Thats right, thats what I did the orderby updated bit.

I know I'm doing it wrong, I just cant figure out whats the right way todo it.
by Smasher
Sun Sep 30, 2007 4:43 pm
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

Makes no difference :s
by Smasher
Sun Sep 30, 2007 3:50 pm
Forum: Databases
Topic: Ordering by a different table?
Replies: 27
Views: 3875

Ordering by a different table?

SELECT t.id FROM `Thread` t JOIN `Post` p ON (p.thread_id = t.id) WHERE t.`forum_id` = $id GROUP BY p.`thread_id` ORDER BY p.`updated` DESC Basically, Im returning a list of threads per forum via a query, however the list of threads should be returned by the post updated time. However it seems this...