Jump to content
xisto Community
Sign in to follow this  
iGuest

How to set-up a database to record info

Recommended Posts

If I set-up a feed back section on my pages such as the example below how do I record the results in a database?

** scroll to the bottom of the page.

https://libbey.com/



I need to record the feedback and don't know how. Please help me.

Share this post


Link to post
Share on other sites

Well, it's late, but I can give you a quick overview of it. As to setting up the database, I haven't gotten acceptance yet, so I couldn't help ya there. I'm assuming you just go in your cpanel->mysql databases-> add database.Now you have a database... you need a table :D phpMyAdmin can help you there or you could write the code on a php file and execute it online. Once again, I haven't been able to see what the cPanel looks like, but under phpMyAdmin, go under your database and try to add a table. Here, you need to specify how many fields you're going to have.Let's say you have a database of visitor info. You might want to keep track of visitor's name, ip address, how many times they've been to your site. So you'd need 3 fields.Anywho, once you figure out how many files you need, you need to name them and specify their types. You'll most likely be using VARCHAR which is essentially a string. So if you make a field VARCHAR with size 30, it can have a string of 30 characters at max. Others are INT for integers (numbers). So, you just name the fields and specify what types you want them to be.Now your table is setup... It looks like the user will submit a form. So, when you set up the form, you'll set up possible values for form variables. Once the user clicks on something or types in something and finally submits it, then that info will be sent to another page (php or something), then you'll write SQL code in there that takes the form variables and inserts them into the sql database :D So yeah, in this page of php code, you'll have to write SQL code in it to insert the data in your table you just created :D I don't remember the code off the top of my head, but there are tons of tutorials. Look up "MySql INSERT." That should help ya.I hope this helps!

Share this post


Link to post
Share on other sites

Well I can supply you a script. Which is my guestbook but I can easily make it into a feed back section for you!I will include the following:Name:Date:Message:Which is simple to do.It is very basic as I am a n00b at php and mysql.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.