Jump to content

three table join


cluelessnoob

Recommended Posts

I need help with this join. Any ideas what I'm doing wrong.

 

SELECT facName.facility,facAddress.facility, CONCAT(facCity.facility, ', ', facState.facility) AS loc, facZip.facility,refRateID.Urating,refFID.Urating,RateID.Ratetype,RateType.RateType FROM facility,Urating,Ratetype WHERE (facZip.facility = '$zip' AND refFID.Urating = FID.facility AND refRateID.Urating = RateID.RateType) LIMIT $start, $display";

Link to comment
https://forums.phpfreaks.com/topic/143227-three-table-join/
Share on other sites

Some of your query looks backwards. it should be columnName.columnValue:

 

facName.facility,facAddress.facility, CONCAT(facCity.facility, ', ', facState.facility) AS loc

should probably be:

facility.facName,facility.facAddress, CONCAT(facility.facCity, ', ', facility.facState) AS loc

 

That's just a small part of it, but I hope that gets you started. :)

Link to comment
https://forums.phpfreaks.com/topic/143227-three-table-join/#findComment-751751
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.