a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL -
12-13-2008
, 08:22 AM
First let me start out by saying I am a beginner so I apologize in
advance if what I ask is too fundamental.
I am accessing a MYSQL database through a web browser and I am
entering data into data tables using PHP.
The problem I am facing is that the number of input rows on the web
page is not fixed and will vary each time. Someone suggested I use
Javascript and that is why I am here now.
Here is an example of the rows that I would like to be able to fill :
-------------------------------
method | column | cost |
-------------------------------
hplc | RP18 | 600 |
hplc | phyl | 300 |
hplc | rp8 | 300 |
gc | carbx | 900 |
tlc | na | 200 |
-------------------------------
What I would like to do is have the web screen run like the following:
how many methods------ENTER NUMBER (assume 3 for this example)
how many entries for the first method-----ENTER NUMBER (assume 3 for
this example)
how many entries for the second method------ENTER NUMBER (assume 1 for
this example)
how many entries for the third method-------ENTER NUMBER (assume 1 for
this example)
Using these entries, I want to have a series of input boxes or a table
set up on the web page so the user can enter the text and then wiht a
submit button, insert that text into the DB.
So are there any suggestions on how to do this with using javascript
and PHP so that I can enter these values into a MYSQLl DB? |