Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Correct Record Order2
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Correct Record Order2
Miscellaneous
Thread ID:
00621639
Message ID:
00621639
Views:
46
I'm reposting because I got an error during my first post.

eryone.

I've got a unique problem. I'm working on a message board app for my company's intranet. I'm using ASP with foxpro databases and SQL statements. I have a tree which displays the messages just like UT and other sites. My problem is this, I can populate the tree with messages and replys, but the replys do not fall under the correct parent. Here's my SQL statement, and a sample of what I'm talking about.

SELECT * FROM threads ORDER BY thread,thread_parent,thread_level

Wrong order displays:

1rst Message
- Reply1
- Reply2
- Reply3
- Reply to Reply2

Correct order would display:

1rst Message
- Reply1
- Reply2
- Reply to Reply2
- Reply3

Fields:
Thread..............|..Thread_Parent.. | MessageID
2002049105517 | 2002049105517 | 2002049105517
2002049105517 | 2002049105517 | 2002049105558
2002049105517 | 2002049105558 | 2002049105622
2002049105517 | 2002049105558 | 2002049105703
2002049105517 | 2002049105622 | 2002049105802
Doug Phillips
Next
Reply
Map
View

Click here to load this message in the networking platform