Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Display lookup values in list1
Display lookup values in list1 [message #1479] Tue, 15 July 2008 16:01 Go to next message
bonzo_bcn is currently offline  bonzo_bcn
Messages: 152
Registered: June 2008
Senior Member
My table has several lookup values:
1,basketball
2,footbal
etc.

In the list1 transaction only the number is displayed. Is it possible to display the name instead of the number?

[Updated on: Tue, 15 July 2008 16:01]

Report message to a moderator

Re: Display lookup values in list1 [message #1508 is a reply to message #1479] Fri, 18 July 2008 07:02 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Yes. Simply define that column as being a dropdown list, as described in http://www.tonymarston.net/php-mysql/infrastructure-faq.html #faq09. It will then display the representation (eg: 'basketball') instead of the value (eg: '1').

Re: Display lookup values in list1 [message #1510 is a reply to message #1479] Fri, 18 July 2008 10:31 Go to previous messageGo to next message
bonzo_bcn is currently offline  bonzo_bcn
Messages: 152
Registered: June 2008
Senior Member
I found out that if the description field of each dropdown had the same name, then the description wasn't displayed, that was the problem I had.

For example:

Category table:
category_id
name

Sport table:
sport_id
name

Then if in the 'team' table you define two fields as dropdowns to this tables, as both have the same description name, the name was not displayed. I changed the field names to:
Category table:
category_id
category_desc

Sport table:
sport_id
sport_desc

and it worked.
Re: Display lookup values in list1 [message #1511 is a reply to message #1510] Fri, 18 July 2008 10:42 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Using generic names such as ID, DESCRIPTION or NAME on different tables is never a good idea IMHO, for reasons discussed in http://www.tonymarston.net/php-mysql/database-design.html#fi eld.names.and.content.

I'm glad you've got your problem sorted out.


Previous Topic: How to make enquire 1 show child records in many to many relationship
Next Topic: Create a button like 'Export to PHP'
Goto Forum:
  


Current Time: Thu Mar 28 07:04:09 EDT 2024

Total time taken to generate the page: 0.01092 seconds