Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling HTML form-option value tags with database query result

Status
Not open for further replies.

RustyDWO

Technical User
Mar 14, 2002
65
NL
We have this database with search form in MS-Access.
We use cascading comboboxes with the following code to minimize the length of the list and to make the shown items unique.


SELECT DISTINCT Categorie.Categorie
FROM Categorie;

Private Sub Catzoek_AfterUpdate()
Me!Subzoek.Requery
End Sub

SELECT DISTINCT Categorie.Subcategorie
FROM Categorie
WHERE (((Categorie.Categorie)=[Forms]![Zoekscherm]![Catzoek].[value]));


The result is that only the Subcat items are shows that fit with the selected Cat-item.
It works fine so thats not the problem.

However we need on every PC the program MS-Access.
We would like to change it to a web-bases thingy with PHP.

With the brainstorming of "what is required" our bigest worry is to bring the result from the query/SQL into the html code. More specific in the option values of the forms that are programmed there.

Is this idea possible or to much to ask for?


Any comment or suggestion is welcome.
Thanks ahead
 
Your problem can be easily taken care of in PHP.
Connecting HTML output with dynamic information from a datasource is one of the main reasons for PHP to exist. I would consider your problem scenario fairly "trivial", no disrespect intended.
 
DRL478,
Thanks for the response but your talking about HTML output.
I'm not really thinking of that.
For every combobox used in the Accsess form I thought of making a form with selection options.
Instead of programming in HTML all possible options for both lists, I'd like to have the same presentation as in Access.
So as soon as an option list (form) is clicked upon, a script is sent to the database and a result is "stored" in the webpage as the options where an actual selection can be made which sents a second instruction to show the selection in the webpage and requiry the second "combobox".

Does this still make sense?

Thanks again
 
That is also possible.
What you are talking about is basically writing a more and more complex "WHERE" condition for a SQL command.
You can pass values in PHP from one page to the next.
The process is the same:
You select a value in box1 and submit the page. The Web server handles it and returns the page with the second box filled according to your first choice. It just keeps repeating like that.
 
DRJ478,

Thanks for your support.
After a long search through this forum I also found thread 434-615782 and that suggests to use Java as well.
Anyway; its possible to do
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top