SaintDog
06-21-2003, 04:24 PM
I am working on a small hack for vBulletin and need to get a JOIN query to output the right data depending on a few things.
To start, I have 2 tables, one named hd_posts and the other hd_replies. What I want to do is when a post is shown, I want the replies with the matching ID to be show as well, if any are available.
Right now, I can show the post just fine, but I cannot create a query that works correctly so that I can call the matching replies as well.
I have outlined the table structure of each below:
hd_posts:
id, name, subtitle, subdate, subtime, message, and hashid
hd_replies:
id, tid, name, subtitle, subdate, subtime, message, and hashid
The tid is the ID of the matching post.
If anyone could help me get this working, I would greatly appreciate it. I am confused on this one query and cannot get it working at all.
Thanks in advance for anyone kind enough to take the time to help!
- SD
To start, I have 2 tables, one named hd_posts and the other hd_replies. What I want to do is when a post is shown, I want the replies with the matching ID to be show as well, if any are available.
Right now, I can show the post just fine, but I cannot create a query that works correctly so that I can call the matching replies as well.
I have outlined the table structure of each below:
hd_posts:
id, name, subtitle, subdate, subtime, message, and hashid
hd_replies:
id, tid, name, subtitle, subdate, subtime, message, and hashid
The tid is the ID of the matching post.
If anyone could help me get this working, I would greatly appreciate it. I am confused on this one query and cannot get it working at all.
Thanks in advance for anyone kind enough to take the time to help!
- SD