Solved

PHP & MYSQL

Posted on 2002-07-29
6
271 Views
Last Modified: 2006-11-17
I am using PHP to write data to a MySQL database. A user should fillout up-to 3 separate forms. How do I save this information in the database in 3 different tables. Is my question clear?

Do I use sessions? Do I use cookies?  Is there another alternative?  

diverdiver.
0
Comment
Question by:diverdiver
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Expert Comment

by:DImirC
ID: 7187040
What do you mean at "A user should fillout up-to 3 separate forms"?
0
 
LVL 1

Accepted Solution

by:
azzkikr earned 150 total points
ID: 7187648
Hey diverdiver,

If I understood you correctly you are talking about consequently filled forms, a survey in other words.
Usually when one requires a user to fill three consequent forms he will need all three filled out, so there is no point to store each one separately to the database.
On the other hand, storing the data entered in the session object isn't a good idea, because they usually should be kept relatively small, especially on heavily loaded sites, otherwise you'll end up with your server engine consuming too much memory or constantly serializing the session objects. Keeping this data in session may worth it in only rare case when you require disconnected user to continue his survey.
So, I think the best way is to pass the data in the hidden fields. It will require more network traffic from and to client, but it is simple and reliable.

Hope this helps,
Stas
0
 

Author Comment

by:diverdiver
ID: 7187967
Yes a user most fill out up to 3 forms. I had to separate it into three forms as there is a lot of information that needs to be filled out by the user.

diverdiver.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 1

Expert Comment

by:azzkikr
ID: 7188074
So does my comment answer your question then? ;)

Stas
0
 
LVL 4

Expert Comment

by:lokeshv
ID: 7188223
if your data is just the text data i dont think Session would affect performence  of your system.

session data is stored in the tmp files on the server and you can store upto 2 mb of data


and in ur case if its just text data then it shld be arnd 2-3 kb.. so shld affect performence at all.



Regards,
Lk
0
 
LVL 8

Expert Comment

by:GEM100
ID: 7201168
Pass the data from form to form using INPUT TYPE=HIDDEN, and let the final form insert it all into database(s).
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Put POST values into cookies. 14 51
PHP Underscores vs. Directory separators 5 44
Which is best Image Resizing Web service 11 32
sitemap.xml 3 23
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question