View Single Post
Old 05-21-2006, 11:23 AM   #1 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 150
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
Need help with a MySQL query

Here's the description of the query I need to make:

SELECT comments.*, user.user_dname (where user.user_id = comments.user_id), user.user_dname AS replyto_user_dname (where user.user_id = comments.replyto_user_id) FROM comments WHERE blog_id = bid


What I'm doing is selecting all comments made on a specific blog entry, and in each row I need to include the posters display name, and the display name of the person the poster is replying to. I was thinking I needed to perform some sort of JOIN, but then I'm not sure if I can perform conditional statements for specific fields? My brain hurts.
__________________
Current Project
Redline is offline   Reply With Quote