Martin Lang wrote:
> Mysql reports "Unknown column 'champ_women.ClubID' in
'on clause'"
>
> That column exists definitely. The select works online
without any
> problem but fails locally (MySQL-Client-Version:
5.0.22). Has it to do
> with different mysql-versions?
Yes. The way joins work was altered in MySQL 5.0.12 to bring
it into
line with the SQL standard. The situation is explained on the
following
page (you have to scroll down a long way to find it):
http://dev.mysql.com/doc/refman/5.0/en/join.html
It's quite complicated, but I think the following should
work:
SELECT Place,TN1nn, TN1vn, Points, places.City, places.Year,
clubs.Clubname, countries.countryname
FROM places, countries, champ_women LEFT JOIN clubs on
clubs.ClubID=champ_women.ClubID
WHERE champ_women.CityID=places.CityID AND
champ_women.CountryID=countries.CountryID
Alternatively, try this:
SELECT Place,TN1nn, TN1vn, Points, places.City, places.Year,
clubs.Clubname, countries.countryname
FROM (champ_women, places, countries) LEFT JOIN clubs on
(clubs.ClubID=champ_women.ClubID)
WHERE champ_women.CityID=places.CityID AND
champ_women.CountryID=countries.CountryID
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/