Pulling additional data into an admin page
2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 5, 2010 (RSS)
By ispro - October 5, 2010
There is probably a laughably simple answer to this: I have two tables, say MEMBER and TRANSACTION. When in the TRANSACTION admin screen I can display a list of member names from the MEMBER record, and choose to store the member number and display the name. I would however also like to show the member number as well. How do do it? I've been furtively examining the "Related records" feature, but there appears to be no documentation on it, and I don't hav the time to figure it out.
Re: [ispro] Pulling additional data into an admin page
By Jason - October 5, 2010
Hi,
So if I understand you have a pull down field that pulls information from the MEMBER table. It's value is the num field and the label is the name field. You're already displaying the name when you're viewing your list of records, and you want to be able to view the number as well. Is that right?
If so, what you need to do is to make the num and the name part of your label. Edit your member field in your transaction table. For "List Options" select "Get Options From Mysql Query". Use this query:
This will display the record number and their name separated by a "-" like this:
5 - MemberName
Hope this helps.
So if I understand you have a pull down field that pulls information from the MEMBER table. It's value is the num field and the label is the name field. You're already displaying the name when you're viewing your list of records, and you want to be able to view the number as well. Is that right?
If so, what you need to do is to make the num and the name part of your label. Edit your member field in your transaction table. For "List Options" select "Get Options From Mysql Query". Use this query:
SELECT num, CONCAT(num," - ",name)
FROM `<?php echo $TABLE_PREFIX ?>member`
This will display the record number and their name separated by a "-" like this:
5 - MemberName
Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/