Re: [PHP] $this->db->Record["WLPcountry.name"]
That did the trick Philip! Thanks for your help. Mike Philip Murray wrote: > - Original Message - > From: "Mike Gifford" <[EMAIL PROTECTED]> > >>Hello, >> >>I'm using phplib to add functionality to my bibliography app. However I'm >> > not > >>sure how to deal with selected data from different tables with the same >> > field name. > >>The example I provided in the signature was: >>$this->db->Record["WLPcountry.name"] >> >> > > Which needs to be differentiated from: > >>$this->db->Record["WLPpublisher.name"] >> >>Any suggestions would be useful... >> >> > > You can use the AS keyword to rename the fields to whatever you want, for > example: > > SELECT > WLPbib.bibID, > WLPbib.title, > WLPbib.publicationDate, > WLPbib.URL, > WLPpublisher.name AS publisher_name, > WLPaddress.city, > WLPaddress.state, > WLPaddress.countryID, > WLPcountry.name AS country_name, > WLPprofile.firstName, > WLPprofile.middleName, > WLPprofile.lastName, > WLPprofile.organization > FROM > WLPbib > > > So then, you'd have: > > $this->db->Record["country_name"] > > and > > $this->db->Record["publisher_name"] > > Hope this helps! > > Cheers > - -- - - - > Philip Murray - [EMAIL PROTECTED] > http://www.open2view.com - Open2View.com > - - -- - - > > -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] $this->db->Record["WLPcountry.name"]
- Original Message - From: "Mike Gifford" <[EMAIL PROTECTED]> > Hello, > > I'm using phplib to add functionality to my bibliography app. However I'm not > sure how to deal with selected data from different tables with the same field name. > > The example I provided in the signature was: > $this->db->Record["WLPcountry.name"] > > Which needs to be differentiated from: > $this->db->Record["WLPpublisher.name"] > > Any suggestions would be useful... > You can use the AS keyword to rename the fields to whatever you want, for example: SELECT WLPbib.bibID, WLPbib.title, WLPbib.publicationDate, WLPbib.URL, WLPpublisher.name AS publisher_name, WLPaddress.city, WLPaddress.state, WLPaddress.countryID, WLPcountry.name AS country_name, WLPprofile.firstName, WLPprofile.middleName, WLPprofile.lastName, WLPprofile.organization FROM WLPbib So then, you'd have: $this->db->Record["country_name"] and $this->db->Record["publisher_name"] Hope this helps! Cheers - -- - - - Philip Murray - [EMAIL PROTECTED] http://www.open2view.com - Open2View.com - - -- - - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] $this->db->Record["WLPcountry.name"]
Hello, I'm using phplib to add functionality to my bibliography app. However I'm not sure how to deal with selected data from different tables with the same field name. The example I provided in the signature was: $this->db->Record["WLPcountry.name"] Which needs to be differentiated from: $this->db->Record["WLPpublisher.name"] Ive added the table name (WLPpublisher & WLPcountry) as a prefix assuming that this will carry over. Seems to wrok in some instances but not others. Any suggestions would be useful... The table is as follows: SELECT WLPbib.bibID, WLPbib.title, WLPbib.publicationDate, WLPbib.URL, WLPpublisher.name, WLPaddress.city, WLPaddress.state, WLPaddress.countryID, WLPcountry.name, WLPprofile.firstName, WLPprofile.middleName, WLPprofile.lastName, WLPprofile.organization FROM WLPbib LEFT JOIN WLPpublisher USING(publisherID), WLPaddress LEFT JOIN WLPcountry USING(countryID), WLPprofile LEFT JOIN WLPbib2profile USING(profileID) WHERE WLPpublisher.addressID = WLPaddress.addressID AND WLPbib2profile.bibID = WLPbib.bibID I'm making progress on this app. Thanks to the assistance of a lot of good folks. Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]