Hello,
I am currently having a bug with a MYSQL query for an online calendar I am writing. I have been looking at this bug for a couple days now and am still not able to figure out why it continues to do it.
I have 2 tables called calendar_users and comments
calendar_users has these fields in it: user_id, dispname, username, password, color, login
comments has these fields in it: comment_id, orig_user_id, month_posted, day_posted, year_posted, comment, upd_user_id
Here is the query im looking at right now:
k.. the issue I am having with this query is there are 2 comments posted on the same date by 2 different users. However on the page itself is shows 4 comments: the first one, the second one, the first one again, the second one again. The comments are at least matching up with the color chosen for them so I know that the query is halfway working, but am unable to fix the repeating issues. Any ideas you can give?
I am currently having a bug with a MYSQL query for an online calendar I am writing. I have been looking at this bug for a couple days now and am still not able to figure out why it continues to do it.
I have 2 tables called calendar_users and comments
calendar_users has these fields in it: user_id, dispname, username, password, color, login
comments has these fields in it: comment_id, orig_user_id, month_posted, day_posted, year_posted, comment, upd_user_id
Here is the query im looking at right now:
Code:
$query = " SELECT DISTINCT a.color, o.comment FROM calendar_users a, comments o WHERE o.month_posted='" . $month . "' AND o.day_posted='" . $date . "' AND a.user_id=o.upd_user_id";
Comment