Forums

This topic is locked

Query Returns Country/County Unique ID rather ....

Posted 21 May 2002 21:05:48
1
has voted
21 May 2002 21:05:48 Adrian Burns posted:
Query Returns Country/County Unique ID rather ....

Does anyone know how to make Ultradev return the name associated with a unique id. for exampleI have a table called bu_sell_items that contains links to a county and country table via the countyID and CountryID. But when I do show the results of a search i get the id instead of name's.
Can this be done with Ultradev rather then hand coding.


Thanks Adrian

Replies

Replied 22 May 2002 12:20:01
22 May 2002 12:20:01 Julio Taylor replied:
To do this, you'll need to write some SQL code, Ultradev won't do this for you... Below, i'll write an example of how to do this, assuming that you are passing the variable "countryID" as "varCountryID" (as a GET URL variable).

Your quesry will have to be written in the detial page, and make sure that you send the countryID as a GET variable from the master page.

<pre id=code><font face=courier size=2 id=code> SELECT country_name, county_name FROM country_master, buy_sell_items WHERE country_master.countryID = varCountryID (&lt;-- this is the GET variable) AND country_master.countryID = buy_sell_item.country_ID </font id=code></pre id=code>

this should return all the records, filtered by the countryID you specified, alongside the actual names of the countries instead of the record ID numbers.

If this doeasn't work, let me know (on e-mail) and i will try to help you out some more <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

i hope this helps.

--J

P.S. i killed kenny
Replied 22 May 2002 18:17:27
22 May 2002 18:17:27 Adrian Burns replied:

Thanks for your help I will let you know once I get in to test it.

Adrian


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
To do this, you'll need to write some SQL code, Ultradev won't do this for you... Below, i'll write an example of how to do this, assuming that you are passing the variable "countryID" as "varCountryID" (as a GET URL variable).

Your quesry will have to be written in the detial page, and make sure that you send the countryID as a GET variable from the master page.

<pre id=code><font face=courier size=2 id=code> SELECT country_name, county_name FROM country_master, buy_sell_items WHERE country_master.countryID = varCountryID (&lt;-- this is the GET variable) AND country_master.countryID = buy_sell_item.country_ID </font id=code></pre id=code>

this should return all the records, filtered by the countryID you specified, alongside the actual names of the countries instead of the record ID numbers.

If this doeasn't work, let me know (on e-mail) and i will try to help you out some more <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

i hope this helps.

--J

P.S. i killed kenny
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Reply to this topic