470,856 Members | 2,573 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,856 developers. It's quick & easy.

Getting started saving form data to a CSV file and/or database.

Can anyone help me with a form I'm trying to make? I'm trying to make a submission form for my school's literary magazine. I need to put the submitted information into a database. I know I need to use PHP to process the form data, but can someone tell me how? I've read about using MySQL, but I want to keep this as simple as possible. Can I just put the information directly into an excel database? Or do I have to put the information into a CSV file that can be imported into excel?

Another part of the submission form is that it needs to be able to put files into the database as well, which I think complicates things.

Thanks a bunch!
Aug 25 '07 #1
3 2203
IMHO using database is by far the easiest solution, after you cover some basics first.
Use this as reference http://www.php.net/manual/en/ref.mysql.php

Pay attention to functions:
mysql_connect(), mysql_select_db(), mysql_query() and mysql_close()
you'll be using them in that order...

And if you need an easy to install server to test those things you might wanna try this one: http://www.apachefriends.org/en/xampp.html

As for a more detailed tutorial, just google it, there are tons of introductory texts for this kind of thing you're trying to do.
Here's a couple:

May the source be with you!
Aug 25 '07 #2
5,058 Expert 4TB
Hi, and welcome to TSDN!

You could take a look at these two articles I wrote. One deals with Forms and PHP, the other deals with the basics of MySQL databases.

- Using Forms to pass data to PHP
- MySQL Basics

There is also a lot of information on this subject floating around the net, a simple google search will most likely provide a list of good tutorials and discussions.

And, as always, if your having any problems with your code, we will do our best to help you out.
Aug 25 '07 #3
5,821 Expert 4TB
Heya, Phoenix. Welcome to TSDN!

Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as, 'help' actually get FEWER responses?).

If you really don't want or need to use a database, you can output your data as a CSV file. Have a look at fputcsv().
Aug 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by PHPkemon | last post: by
2 posts views Thread by Timo J | last post: by
reply views Thread by Jim | last post: by
reply views Thread by Jim | last post: by
6 posts views Thread by Jack Duijf | last post: by
7 posts views Thread by Dave Kelly | last post: by
6 posts views Thread by sathyashrayan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.