a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL

Status
Not open for further replies.

bukaida

In the zone
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 :
Say for
record 1(Persons living in canada)
---------------------------------
id name address
---------------------------------
1 john canada
2 Jim canada
3 smith canada
-------------------------------

record 2(Persons living in LA)
----------------------------------
id name address
---------------------------------
1 joe LA
2 mathew LA
-------------------------------

I have to design an insert form with textbox which will allow me to insert variable number of records in the table(probably giving an option at the begining,to specify how many records). I am using php 4.4 and mysql 5.1. Please help.
 

asingh

Aspiring Novelist
Is it a data entry form..or a display form..?? That has to have dynamic rows..??
 

lucifer_is_back

Journeyman
just make fix the max number of columns in tables for address
Eg
id
Name
Age
Add1
Add2(Nullable)
Add3(Nullable)
Add4(Nullable)

if a person has more than a single line u can fill it up
 

ramprasad

In the zone
Have a drop down box at the beginning of the page to capture the number of records u want to add.
On the 'OnSelect' or similar function of that Drop down box, associate a JS which will put the 'Input details' (like Name, Country,etc.) required number of times.
 
Status
Not open for further replies.
Top Bottom