LEFT JOIN teams AS home_team ON fixtures.home_id = teams.team_id
LEFT JOIN teams AS home_team ON fixtures.home_id = home_team.team_id
Plus I'm assuming that you do in fact have a team_id column and not just one called id?
| SitePoint Sponsor |



LEFT JOIN teams AS home_team ON fixtures.home_id = teams.team_id
LEFT JOIN teams AS home_team ON fixtures.home_id = home_team.team_id
Plus I'm assuming that you do in fact have a team_id column and not just one called id?

Hold the bus! How can you call y'self geordiewire when your rugby clubs are Lancashire based?
Are you some kinda wars'o'the'roses orphan or what?
Sort of, yeah, mentally.Cups are you uk based?
At least I don't live on top the Penines in a pit stop on the M62.
Guys,
I finally after a little bit of tweaking have a working Query which gives me the results that I required as follows
SELECT fixtures.fixture_date AS fixture_date, competitions.id AS fixtype_id, competitions.competition AS competition_name, home_team.team_id AS home_team_id, home_team.team AS home_team_name, away_team.team_id AS away_team_id, away_team.team AS away_team_name, fixtures.kick_off, referee.id AS referee_id, referee.name AS referee_name
FROM fixtures
LEFT JOIN competitions ON fixtures.fixtype_id = competitions.id
LEFT JOIN teams AS home_team ON fixtures.home_id = home_team.team_id LEFT JOIN teams AS away_team ON fixtures.away_id = away_team.team_id LEFT JOIN referee ON fixtures.referee_id = referee.id
WHERE fixtures.fixtype_id =1
AND fixtures.age_group_id =15
AND fixtures.finalised =0
It means that I can get the fixtures page working as required and then I need to look at the previous results section.
Thanks for your help so far, I will be back shortly when doing the results.
Another question, hopefully this one will be simpler than many of my previous.
I have email addresses stored in the database that when displayed I would like to be turned into an email link.
How would I do this?
Is this what you're after?:
PHP Code:<?php
$query = mysql_query("SELECT email, name FROM table");
while($row = mysql_fetch_array($query)){
printf('<a href="mailto:%s">%s</a>', $row['email'], $row['name']);
}
Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
Excuse my ignorance but where will I put that code?
I am using dreamweaver to build the site which I beleive isnt really the done thing with PHP according to Hard Core Coders!!
Another question if I may, can anyone now point me in the direction of search tutorials which will allow me to search the fixtures table depending on a date range, an age group or a particular team.
Also how would I write a WHERE clause to show results within the last 7 days?
Many Thanks
Paul
Help Please?
Bookmarks