Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 25-06-2009, 10:38 AM   #1 (permalink)
In The Zone
 
bukaida's Avatar
 
Join Date: Jul 2005
Location: KOLKATA
Posts: 267
Default a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL


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.
__________________
Desktop: P-IV 2.4GHz, 512MB DDR, 865GBF Mother Board,
G-Force 5200FX, 17" Samsung flat, WinXp with SP2,
Kaspersky Internet Security 2009.
Laptop:LENOVO 3000 C100 D7 lappy with 2GB DDR2.
bukaida is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 05-07-2009, 01:20 PM   #2 (permalink)
Right Off the Assembly Line
 
adatapost's Avatar
 
Join Date: Jul 2009
Location: India/Gujarat/Mehsana
Posts: 14
Default Re: a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL

create a form for each record.
adatapost is offline  
Old 07-07-2009, 03:09 PM   #3 (permalink)
In The Zone
 
bukaida's Avatar
 
Join Date: Jul 2005
Location: KOLKATA
Posts: 267
Default Re: a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL

Quote:
Originally Posted by adatapost View Post
create a form for each record.
How will you know in advance about your data?
__________________
Desktop: P-IV 2.4GHz, 512MB DDR, 865GBF Mother Board,
G-Force 5200FX, 17" Samsung flat, WinXp with SP2,
Kaspersky Internet Security 2009.
Laptop:LENOVO 3000 C100 D7 lappy with 2GB DDR2.
bukaida is offline  
Old 08-07-2009, 11:23 PM   #4 (permalink)
Searching for Anti-Matter
 
Power_user_EX's Avatar
 
Join Date: Aug 2008
Location: Mumbai
Posts: 198
Default Re: a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL

plz explain ur problem a bit more.
__________________
Q6600 @ 3.8Ghz , Sapphire HD6950 2GB @ 920/1370 , 4GB DDR2 Corsair DHX , Razor DeathAdder , Corsair HX 850 ... and what else ...
Power_user_EX is offline  
Old 01-10-2009, 04:44 PM   #5 (permalink)
Super Moderator
 
asingh's Avatar
 
Join Date: May 2008
Location: New Delhi
Posts: 5,548
Default Re: a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL

Is it a data entry form..or a display form..?? That has to have dynamic rows..??
__________________
MSI P45 Platinum(BIOS v1.7B)|Q9550[E0]@3.85Ghz@1.320V[453x8.5]MCH@1.184V|ICH@1.55V|DDR_V_Ref_A_B@1.05V|NH-D14|Corsair TWIN2X4096-8500C5(5-5-5-15)@1089Mhz@2.14V
2xHD4890[Xfire]@1000/900[MEM/GPU]|Corsair 650TX|Seagate180GB+80GB+WD1TB|SONY-DVD-R|CM690|2x120mm Scythe Ultra Kaze|DELL S2409W|APC 1100VA|Scythe Kaze Server
Windows 7 Ultimate RTM - 64BIT|Catalyst 10.5 (8.14.10.0753) forced with RadeonPRO|PS3 160GB|Sony 40EX520|AC Ryan POHD Mini|APC 800VA|APC 800VA|D425KT|CM100 Elite|2TB WD|Acer D255

Test your spoiler tags before submitting
asingh is online now  
Old 18-10-2009, 04:08 PM   #6 (permalink)
Broken In
 
Join Date: Oct 2008
Posts: 133
Default Re: a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL

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
lucifer_is_back is offline  
Old 22-10-2009, 02:15 PM   #7 (permalink)
In The Zone
 
ramprasad's Avatar
 
Join Date: May 2004
Location: 00-1D-7D-5A-34-2E
Posts: 375
Default Re: a variable number of inputs using JAVASCRIPT for PHP to insert MYSQL

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.
ramprasad is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Sujeet
- by gforz
- by soumya

Advertisement




All times are GMT +5.5. The time now is 03:14 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2