dhilke Posted September 3, 2005 Posted September 3, 2005 I have a RecordSet from a table full of people, that includes each person's ID#, name, etc. and parent's ID#. I want to display a list of everyone in a Repeat Region, but for each individual I also want the parent's "name" displayed along with the parent's ID#. Do I have to create a second RecordSet from the same table? How do I display the right name?? I'm not seeing how to do this in DreamWeaver(MX)... Maybe I haven't explained my problem well enough, but if you can make sense out of this and know what I'm not seeing, I'd appreciate a pointer. Thanks, Dan Quote
TweezerMan Posted September 4, 2005 Posted September 4, 2005 I don't really know anything about DreamWeaver, but to do what you're asking, it sounds like you need to have DreamWeaver perform a query that joins the table you're using with whatever table contains the parent ID numbers and names. The query would pull data from both tables, getting the parent name for the parent ID number stored in the first table. The parent name would then be a field in your recordset that you can display like any other field in your recordset. I don't know what kind of query you have DreamWeaver performing now, but assuming it a simple query like this: >SELECT * from people ('people' is the name of the table you're querying now) ...you could join it with a 'parents' table to get the parent name like this: >SELECT people.*, parents.name as parentName from people JOIN parents ON people.parentID = parents.id Hope this helps... Quote
dhilke Posted September 6, 2005 Author Posted September 6, 2005 (edited) The "recordset" is basically the query. Each person and all their data are in an array. What I am doing is displaying everyone with all their data in a table, repeated for each entry. What I'm missing is how to display the name of each person's parent. The parent is in the same array; just a different entry. Each person has an ID#, and so I can display each person with their own ID# among all their data and also their parent ID# (as that's in the same db table row). But I can't figure out how to use that parent ID# and display the parent's NAME using it... Does it require a second query of the same table (at least ID# and name)? Edited September 6, 2005 by dhilke Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.