I have a query like so:
<cfquery name="qchallenges" datasource="#Application.ds#"> SELECT * FROM newchallenges a INNER JOIN team b on a.sentby = b.id WHERE a.team_id = '#session.team.id#' AND a.expired = 'yes' OR a.declined = 'yes' OR a.accepted = 'yes' </cfquery>
I have to pull results ONLY where the team_id matches the session.team.id, but also IF a.expired equals yes, a.declined equals yes, a.accepted equals yes among that team_id
I am having a problem with that stament pulling out information even if the team_id doesn't match. Example is it searches the database and found that the a.accepted field has a match so it shoes it even though the team_id doesn't match the session.team.id. I can't have that happening.

New Topic/Question
Reply



MultiQuote






|