Skip to main content
Participant
August 28, 2009
Question

2 where statements

  • August 28, 2009
  • 1 reply
  • 576 views

I have 3 seperate tables on a database and have built forms to add and edit the information in these tables.

Club Details

Team Details

the 3rd table holds an ID Column and age groups 13, 14 and 15

The user enters information about a club.

The user then enters a teams details and selects the club that this team belongs to from a radio box drop down which adds a club_id to the team details table when the information is submitted.

On the team detail form there is a second drop down box allowing you to select 13, 14, 15 as the age group of that team.

I have then been trying to create a page that displays the information, the club information and then the teams related to that club using a where clause.

On the display page I will have an area for under 13s information, under 14s information and under 15s information.

Please see page at http://www.nwc13-15arl.co.uk/club_team_details_master.php (This page is only using the where club_id = statement and is the reason that you are seeing the under 15s details displayed correctly.)

What I am trying to do is use 3 recordsets, one for each age group so that the team information is shown correctly.

The image below shows what I currently have working however I went to use to where statements, I am presuming it is something to do with the Colname section in the SQL box below but I dont quite know how to do what I want.

I really hope someone can help as I have hit a brick wall.

Many Thanks

Paul

This topic has been closed for replies.

1 reply

Participating Frequently
August 28, 2009

I'm not really sure what you are asking. Are you trying to join two tables? Are you trying to include more than one condition in the where clause ? A select statement can only have one where clause but you can include many conditions using AND/OR. What are the conditions you want to include in the where clause?

Lon_Winters
Inspiring
August 28, 2009

I'm pretty sure you need to use a nested query - here's one example:

http://www.sql-tutorial.com/sql-nested-queries-sql-tutorial/