This topic is locked

Relational database

8/18/2011 5:47:17 PM
PHPRunner General questions
A
aamato author

I am trying to create a dropdown selector that lists only the 'companies' from the selected 'doctor'. As each 'doctor' may work in different companies, i created 3 tables. The first one 'doctor' has also an 'id", the second one 'company' has an 'id', and the third table relates 'doctor' to 'company' so it has only 3 fields each one an 'id', 'id_doctor' and 'id_company'

Now, to create the drpdown, there is no way to retrieve the 'ids' from the relational table and then get the id names from the 'company' table, only for the selected 'doctor'.
The function "this dropdown is dependent on" does not work for what I need...
Any suggestions ??
Thanks a lot

A
aamato author 8/20/2011

I studied the subject, and now at least I know the name of what I need.

I have a many to many database. This is working fine. The problem is retrieving this data on a dropbox.

I want a dropbox that lists only the 'companies' for the selected 'doctor'.
Any help ??
Thanks a lot
Alexandre Amato

vascular.pro

Sergey Kornilov admin 8/20/2011

To the best of my knowledge dependent dropdowns will work just fine here.
If for any reasons it's not working for you post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. Probably we'll be able to provide a better advice once we see your application and data.

C
cgphp 8/22/2011

Create a VIEW in your db (not in PHPrunner) for the third table and add a field to recover the name of the company. More info about VIEW in MySQL here: http://dev.mysql.com/doc/refman/5.0/en/create-view.html

The VIEW should contain the following fields:

id_doctor,

id_company,

company_name


Then, use the VIEW as the source of your company dropdown. Remember to select the "This dropdown is dependent on..." option.