If I have a form with 50-200 input fields, how can I submit them as one PHP/MYSQL insert command?
Ex. Form has input fields of: Lastname, Firstname, SS#, favorite color.
How can I submit all of these/consolidate into a MYSQL table with field name Personalinfo?
Thank you in advance,
MO
1 1326 Atli 5,058
Recognized Expert Expert
Hey.
You want to insert the data form 50-200 form input fields into a single field in a MySQL table?!
You never put more than a single piece of data into a single field. It's the first, and most important, rule of database design.
If you need to store 50-200 pieces of personal info on your users, you either create a single table that has 200 columns, one for each possible piece of data (not every field has to be filled for each row), or you create a "dynamic" table, where you just store a key/value pair, filling in each as you go.
Example of the first option: (very basic) - +----+-----------+-----------+----------+---------------+--------+
-
| id | ss_number | firstname | lastname | favorit_color | etc... |
-
+----+-----------+-----------+----------+---------------+--------+
-
| 1 | 11111111 | John | Doe | Blue | ... |
-
| 2 | NULL | Jane | Doe | Red | ... |
-
+----+-----------+-----------+----------+---------------+--------+
(Note the NULL for the second row's ss_number field. Indicates that there was no value provided for that field.)
Example of the second option: - +----+-----------+----------+
-
| id | firstname | lastname |
-
+----+-----------+----------+
-
| 1 | John | Doe |
-
| 2 | Jane | Doe |
-
+----+-----------+----------+
-
+----+---------+---------------+-----------+
-
| id | user_id | key | value |
-
+----+---------+---------------+-----------+
-
| 1 | 1 | favorit_color | Blue |
-
| 2 | 1 | ss_number | 11111111 |
-
| 3 | 2 | favorit_color | Red |
-
+----+---------+---------------+-----------+
(Here, the absence of the second user's ss_number just means that it is not inserted into the key/value table.) Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tom |
last post by:
I have created the following code for a product select/payment form (don't know if there is a better
way) and I have been trying to make the following changes (unsuccessfully so far):
1) Eliminate the submit button and submit the form with onchange.
2) Open the action php page in a new window.
I am using this code for different payment options (i.e., cc processing and paypal). As such, there
are multiple forms on the page. The...
|
by: Richard Cornford |
last post by:
I am interested in hearing opinions on the semantic meaning of FORM
(elements) in HTML.
I have to start of apologising because this question arose in a context
that is not applicable to the Internet. Specifically, marking up a
document that will contain multiple related form controls (intended
exclusively for client-side scripting) that would never be intended to
be submitted. I realise that that concept is a non-starter in an
Internet...
|
by: Jack |
last post by:
Hi,
I have a asp input form of a financial report. Here most of the fields are
text boxes where the user need to input the values corresponding to an item.
However, there are few items which are calcuated field. Prior to submission
of the information, I would like the user to know what the calculated field
be (based on the information input in text boxes) before submission of the
form. Is there any way to display the calculated value...
|
by: Andy Goldstein |
last post by:
I have a table where all the TRs have an onClick handler registered.
One (and only one) of the rows has 2 text input boxes, where each
textbox has an onChange handler registered. Both the onClick and
onChange handlers do some minor manipulation of form data (although
they work on different form elements). If the onChange event fires, I
need the form to be submitted. If the onClick event fires for a TR, I
also need the form to be...
|
by: Chris Smith |
last post by:
Good morning,
Is there a good way to use JavaScript to send a form submission, but get
back the response as a string, rather than loading it into a page? I
could write the code to send the submission via XMLHttpRequest, but that
seems hard... especially implementing multipart-encoded form submission
such as required for file upload.
Ideas?
| |
by: yawnmoth |
last post by:
Say I have the following HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<form action="">
|
by: Oleg Konovalov |
last post by:
Hi,
I have a Java/JavaScript GUI application where I perform a lot of long DB
operations
, which takes 5-60 secs to perform.
Sometimes user double-clicks the button or just gets impatient and clicks
again,
which created duplicate forcm submission and hence duplicate records.
So I am trying to disable the button as soon as it is clicked, and as soon
as it's done,
|
by: Homer |
last post by:
Hi,
I just got a requirement from my HR department to automate their form
submission process and integrate it into the Intranet project that I
had just completed Phase 1 of. Because of the short time frame that
I've been given, a week to be exact, I do not have the luxury to
explore it on my own so here are the requirements:
1. Automate the personnel forms that employees use for changing their
information, which is currently in pdf...
|
by: rn5arn5a |
last post by:
Nowadays, most websites make use of CAPTCHA to prevent automated Form
submission. Can someone please give me examples of how automated Form
submission can be achieved?
It's not that I intend to do some nefarious activities; rather I don't
understand how can automated Form submission be done other than the
website developer coding it (for e.g. using JavaScript to
automatically post a Form, say, after 2 minutes).
Thanks,
|
by: Megalog |
last post by:
Hey guys.. my turn to ask a question:
I'm having a weird issue with a form I've reworked. This form has a combo box, which when used is changing the recordsource of a subform. This subform has no Master/Child relationship set to the main form. Specifically the problem seems to be that everytime the recordsource of the subform is changed, the subform object itself tries to set a default Master/Child value (both fields fill with the "ID"...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |