Solved

php: read text out of the row/column and put it into mysql

Posted on 2006-11-22
7
537 Views
Last Modified: 2012-05-05
Hello,

Currently, I have a php file that reads a .csv file and puts the text thats in there on a html page in a table, row by row. First and second columns are text from the file, the third and fourth are inputs from the user. The third column is just textarea boxes and the fourth is an option group with a yes or no value. How do I read the text in column 1 2 and 4 that are being submitted row by row into a mysql table?

I have already experimented with creating a table..etc (so its already in there). I can read the value of the text area boxes into the table fine. The things that are missing are column 1, 2, and 4, which are text from the file on the page (1 and 2) and 4 is the optgroup value.

Any help is appreciated!
0
Comment
Question by:worpx
[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
  • 4
  • 3
7 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 250 total points
ID: 18000414
Hi,

The only way to attain this csv information that you printed on the page for the user to view is to either:
1.  Put these values in hidden values on your form- so you can read them back in when submitted
2.  Save these values in a session variable and retreive them when it is time to write to the database
3.  Save these values in a session cookie and retreive them when it is time to write to the database
4.  Save these values in a database table, and storing the primary key of these in any of the above methods, so when it comes to saving you can link to this primary key
0
 
LVL 2

Author Comment

by:worpx
ID: 18000533
Hi,

Thank you for getting back to me so quickly. Can you explain a little more on what you mean by "1.  Put these values in hidden values on your form- so you can read them back in when submitted" and "4.  Save these values in a database table, and storing the primary key of these in any of the above methods, so when it comes to saving you can link to this primary key".

Which would be the easiest to implement and most efficient?

Also, in mysql tables, lets say I am storing these forms and there are going to be 4 per day. Do I store everything in 1 table, appending all the forms or multiple tables for all the different forms. I don't know if mysql will blow up when a certain point is reached.
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 18000547
mysql will not blow up unless you have terrabytes of data in these forms.

depending on your security requirements each may be more efficient.

you can put data into a form by having an input with type = "hidden"

I'd reccomend option 2 for the fastest and most secure option - using $_SESSION[] to save your data
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
LVL 2

Author Comment

by:worpx
ID: 18000572
I don't mean to keep being so inquisitive, but would you happen to have any good examples of this $SESSION[] in use?

Thanks
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 18000624
0
 
LVL 2

Author Comment

by:worpx
ID: 18000699
i'll give it a try; thanks a lot!
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 18000779
Glad I could help you
0

Featured Post

 Database Backup and Recovery Best Practices

Join Percona’s, Architect, Manjot Singh as he presents Database Backup and Recovery Best Practices (with a Focus on MySQL) on Thursday, July 27, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). In the case of a failure, do you know how long it will take to restore your database?

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

615 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