Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

some help with forgein keys in dropdowns

Locked
barrydocks
Posts: 18
Joined: Wed Dec 18, 2013 4:44 pm

some help with forgein keys in dropdowns

Unread post by barrydocks »

I wonder if some one might be able to give me a little help. I have 2 tables with a forgein key from one to the other:
TableA
- A_id
- A1
- A2
- FK_B_id

TableB
- B_id
- B1

I have a form displaying TableA and I want FK_B_id to be a dropdown when adding a record. In the dropdown tab in the objects page for FK_B_id I have added the following SQL code:

Code: Select all

select B_id from TableB
but the dropdown does not get populated with any data.

What am I doing wrong???

Thanks
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: some help with forgein keys in dropdowns

Unread post by zazzium »

Hi,
try

Code: Select all

select B_id,B1 from TableB
First ( B_id) is option value and second (B1) is option text
barrydocks
Posts: 18
Joined: Wed Dec 18, 2013 4:44 pm

Re: some help with forgein keys in dropdowns

Unread post by barrydocks »

Thanks zazzium, works perfectly!

Still on a bit od a steep learning curve with both nuBuilder and mysql :)
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: some help with forgein keys in dropdowns

Unread post by massiws »

.
Locked