Re: $this->db->Record["WLPcountry.name"]

From: Date: Sun, 22 Jul 2001 07:16:49 +0000
Subject: Re: $this->db->Record["WLPcountry.name"]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59047@lists.php.net to get a copy of this message
----- Original Message ----- From: "Mike Gifford" <mike@openconcept.ca> > 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 - webmaster@open2view.com http://www.open2view.com - Open2View.com ------------- - -- - -

« previous php.general (#59047) next »