On Thu, June 29, 2006 9:11 am, Ben Liu wrote: > I'm trying to present the messages to the users in > threaded order rather than flat. I'm having a lot of trouble figuring > out how to sort the posts so they appear in the correct threaded > order. I don't think I can do this purely with a SQL query. You can. The thing to do is to store the "pre-order traversal" as a "threaded tree" in your database. If you Google for those terms along with SQL, you should find some articles that will help you tame this beast. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php