Database Forum
Web Database Register Members List Calendar FAQ

 
Go Back   Database Forum > PHPMagic Discussions > Customization
User Name
Password

Reply
 
Thread Tools Search this Thread Display Modes
Default Multiple Fields in Drop-Down Box
01-28-2007, 05:24 AM #1  

shawnmstout
Junior Member

 
Status: Offline
Posts: 4
Join Date: Oct 2006

I have a Client Page which holds clients data that does not get changed. EX: Name Address ect...

I also have a Clients History Page
I wanted it to be able to list in 1 drop down box the following:
ID
Caller_Last_Name
Caller_First_Name

When this is picked from the Clients page then it would list the clients history. This is severly needed so that the database will function accordingly. In addition to this I have Chapter and Volunteer, when the Chapter is picked, I wanted the list of Volunteers to be filtered out. Please let me know the best way to get this done. I have tried listing multiple listing in 1 combo box with now success, the filtering has not been done yet

please advise asap. I have to get this done by monday
Reply With Quote

Default
01-29-2007, 11:00 AM #2  

Kayla
Senior Member

 
Status: Offline
Posts: 302
Join Date: Mar 2005
Location: USA

I think you will need to execute an sql join between the tables.
Maybe you can use some code from here.
Reply With Quote

Default
01-29-2007, 03:36 PM #3  

Sandman
Moderator

 
Status: Offline
Posts: 98
Join Date: Mar 2005

You will need to add this to the script you are writing that processes the selected option.

The correlation can only be made if at least one column in the two tables contain related data.

Here is an example, the columns that contain related data are emp_id of employee_data and e_id of employee_per.

Here you conduct a table join and extract the names (from employee_data) and spouse names (from employee_per) of married employee.

select CONCAT(f_name, " ", l_name) AS Name,
s_name as 'Spouse Name' from
employee_data, employee_per
where m_status = 'Y' AND
emp_id = e_id;
+-----------------+-----------------+
| Name | Spouse Name |
+-----------------+-----------------+
| Manish Sharma | Anamika Sharma |
| John Hagan | Jane Donner |
| Ganesh Pillai | Sandhya Pillai |
| Anamika Sharma | Manish Sharma |
+-----------------+-----------------+

Because you want to return results from another table you will need to join the tables....
Reply With Quote

Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 12:16 AM.

Powered by: vBulletin Version 3.7.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Database Forums

Help support our forum assistants and product development ->

go to top go to top