Scott, Thanks. That appears to be the solution.
Albert On Fri, Jan 22, 2010 at 10:42 AM, Scott Swaim <sc...@tmcclinic.com> wrote: > I ran into this when I upgraded from 4.0.xx to 5.0.xx There was a change > in > the logic for the Joins. I determined that the FROM clause needs to be in > parenthesis. i.e. FROM (team, person, teamperson) this allows all of > the > fields in all of the tables to be used. The change was made in mysql so > that only the last table (i.e. teamperson) was used for your JOIN > > Scott Swaim > I.T. Director > Total Care / Joshua Family Medical Care > (817) 297-4455 > Website: www.totalcareclinic.com > > > NOTICE: The information contained in this e-mail is privileged and > confidential and is intended for the exclusive use of the recipient(s) > named > above. If you are not the intended recipient or his or her agent, you are > hereby notified that you have received this document in error and that any > use, disclosure, dissemination, distribution, or copying of this message is > prohibited. If you have received this communication in error, please notify > the sender immediately by e-mail, and delete the original message > -----Original Message----- > From: Albert Padley [mailto:ap3des...@gmail.com] > Sent: Friday, January 22, 2010 11:37 AM > To: mysql@lists.mysql.com > Subject: Join Suddenly Failing > > I have a website that gets used once a year for a soccer tournament. It has > been working fine since 2006. No script changes since it was last used in > 2009. All of a sudden the following script started throwing an error. > > SELECT contactinfo.contactdata, contactinfo.ContactID FROM team, person, > teamperson > LEFT JOIN personcontact ON person.PersonID = personcontact.PersonID > LEFT JOIN contactinfo ON personcontact.ContactID = contactinfo.ContactID > WHERE team.teamID = 22 > AND team.TeamID = teamperson.TeamID > AND teamperson.PersonID = person.PersonID > AND person.PeopleTypeID =5 > AND contactinfo.ContactTypeID =2 > > Error: Unknown column 'person.PersonID' in 'on clause' (1054) > > There are several of these type scripts and all are giving a similar error. > > The server version is 5.0.87. I suspect the hosting company may have > upgraded to a new version of mysql. > > Thanks. > > Albert > >