This topic is locked

query using field data

11/23/2008 11:58:21 AM
PHPRunner General questions
W
wildwally author

I think I am starting to get the hang of how PHP works, but still have a long way to go. I'm wanting to have a drop down list display the results of query which uses possibly two fields the user has filed in previously on the page.
I know it can be done I see it in many websites.
Tablename = inventory

feilds on table = year, make, model, serialnumber
Now this does not reflect the actual site, more so to help me better understand whats involved in the process so I can not bother you all as much.
;

$model = $values["model"];
[color="#ff0000"]$result
Am I getting close or still way off? When the user enters the make and model in previous fields the serialnumber field will adjust it's availbe selections based on the make and model.
The next question is would this code reside in the custome section in the veiw? And this bid of code in the default section?
[font="Verdana"][color=#ff0000]$values["serialnumber"]=$result[/font]

J
Jane 11/24/2008

Hi,
set up serialnumber as dependent dropdown box.

Set up Model as master dropdown and serialnumber as dependent dropdown on the "Edit as" settings dialog on theVisual Editor tab.

Also I recommend you to have a look at the How to setup dependent dropdown boxes on Edit/Add pages tutorial:

http://xlinesoft.com/phprunner/php-database.htm

W
wildwally author 11/24/2008

I understand how to set up the relationship on a single item, and maybe I didn't state the question correctly. I was wanting more than condition.

J
Jane 11/25/2008

Hi,
what condition do you mean?

Please post more detailed description of what you want to achieve here.