help in "order by" mysql

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mekha
Forum Contributor
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

help in "order by" mysql

Post by mekha »

i have 2 tables:
1) father table.. (posts table)
2)child table.. (comments table)

now i ordered the results by (id of father) desc.....now what i want is if comment on some post,,,this post is being the first in the order!..
any help please ?
what query to use?
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: help in "order by" mysql

Post by social_experiment »

mekha wrote:now i ordered the results by (id of father) desc.....now what i want is if comment on some post,,,this post is being the first in the order!..
Can you please rephrase this? Do you want the comments to appear in chronological order, i.e first comment last, last comment first?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: help in "order by" mysql

Post by Celauran »

Behaviour similar to a forum? Topics are listed by order of most recent comment, then by order of post date?
Post Reply