filtering results & mysql - now fixed

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
kevrelland
Forum Commoner
Posts: 73
Joined: Mon Jan 08, 2007 7:41 am

filtering results & mysql - now fixed

Post by kevrelland »

Hi i am now filtering the results using a form and drop down menus but i cannot get the sql to filter properly
i can either get it to do the team names or dates but i cant get them to work together
ie if the date selector is working i get no team names and if the team names are working i can't filter by date but they work on their own
here is my sql

Code: Select all

SELECT fixtures.division_num, hteam.team_name AS home_team, ateam.team_name AS away_team, fixtures.fixture_date, fixtures.fixture_time, alleys.alley_name FROM fixtures LEFT JOIN alleys ON alleys.alley_id = fixtures.alley_id LEFT JOIN teams AS hteam ON hteam.team_id = fixtures.fixture_home_team_id LEFT JOIN teams AS ateam ON ateam.team_id = fixtures.fixture_away_team_id WHERE fixtures.fixture_date LIKE '2009-09-11' AND ateam.team_name LIKE '%' OR hteam.team_name LIKE '%' ORDER BY fixtures.division_num ASC, fixtures.fixture_date ASC, fixtures.fixture_time ASC
any ideas?
cheers
Kevin

fixed now
Post Reply