CraigDolphin
GrumpyOldMan in Training
- Local time
- Today, 07:47
- Joined
- Dec 21, 2005
- Messages
- 1,582
ok...provocative title I know. 
I'm working on teaching myself php/mysql and have gotten some functional php scripts working on my local copy of WAMP. I can get query results, and do basic insert/update etc on a mysql database.
The problem I'm faced with is wanting to write a php page that functions similarly to a form/subform arrangement in Access for entering data into one table, and related data in another 'details' table (with a one to many relationship between the tables).
Having found NOTHING that leads in that direction, I'm damned well tempted to just add fields to the first table (there would be a maximum of about 12 extra fields) and be done with it.
But....you knowledgable Access gurus have instilled in me a horror of such non-normalized table designs and I'm having qualms about giving in to the dark side.
I've thought about using the onchange event of an html form input element to call a javascript function that builds the url for the php by looping through form elements and their values, and constructing an extra line dynamically whenever the new element is populated by the user. I can conceptually see how to do this, but I'm told that the url can only contain about 100 characters and some of the input fields will potentially contain paragraphs of text. This would obviously create a big problem because I could not then automatically repopulate the user's input when the php form is reloaded. (I hope that makes some sense).
I'm not asking anyone to do this for me, just whether anyone can point me in the right direction or, ideally, show me a tutorial/example script of someone using php/mysql/javascript to construct a simple form/subform analogue.
Or to bless the unholy denormaliztion which I am contemplating. *shudder*

I'm working on teaching myself php/mysql and have gotten some functional php scripts working on my local copy of WAMP. I can get query results, and do basic insert/update etc on a mysql database.
The problem I'm faced with is wanting to write a php page that functions similarly to a form/subform arrangement in Access for entering data into one table, and related data in another 'details' table (with a one to many relationship between the tables).
Having found NOTHING that leads in that direction, I'm damned well tempted to just add fields to the first table (there would be a maximum of about 12 extra fields) and be done with it.

But....you knowledgable Access gurus have instilled in me a horror of such non-normalized table designs and I'm having qualms about giving in to the dark side.

I've thought about using the onchange event of an html form input element to call a javascript function that builds the url for the php by looping through form elements and their values, and constructing an extra line dynamically whenever the new element is populated by the user. I can conceptually see how to do this, but I'm told that the url can only contain about 100 characters and some of the input fields will potentially contain paragraphs of text. This would obviously create a big problem because I could not then automatically repopulate the user's input when the php form is reloaded. (I hope that makes some sense).
I'm not asking anyone to do this for me, just whether anyone can point me in the right direction or, ideally, show me a tutorial/example script of someone using php/mysql/javascript to construct a simple form/subform analogue.
Or to bless the unholy denormaliztion which I am contemplating. *shudder*
Last edited: