|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
php project plan (SQL PROBLEM)
i am making a project list with comments from users in PHP.
here are the tables: current_projects id project priotity due description active 1 blah 1 1/2 blah 1 users id name 1 John Doe comments id user_id comment active project_id 1 1 blah 1 1 i want to list all comments to a specific project and show who says what here my sql... but it wont work! SELECT u.name, c.comment FROM users u, comments c, current_projects p WHERE u.id=c.user_id AND c.project_id=p.id AND c.active=1 it shows all comments on all projects HELP! thanks sj |
|
#2
|
||||
|
||||
|
You need to add "AND p.id=X" (where X is a project id) in order to limit this to a single project.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
|||
|
|||
|
Im such a dork!
THanks so much... I knew it, but i couldnt see it. What an amateur! :-)
s |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > php project plan (SQL PROBLEM) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|