PHP saving & reading with tables.

How can I make it possible that I can add a table that needs filling out, then once filled out it is submitted o an SQL database. Then once it’s on there, there is a page that is accessed by Admins (I have a login script) and then on there it displays all of the submitted information?

Thanks for the help!

I guess by table you mean html table with form fields?
Here is an example on how you can create database and then submit a form and save form data into database table: http://www.phphelp.com/forum/index.php?topic=9407.0

Thanks!

What about the second part?

So much help, thank you!

By second part, I assume you mean admins viewing submitted data.

For this you need MySQL query “SELECT” which retrieves data from a database. Since you already have a login form you must be familiar with this. All you’d have to do is run the query, and loop through each row (possibly create an array containing each row) and then display each row in a html table.

This tutorial covers displaying information retrieved from a mysql database.

I do have that.

But I don’t FULLY understand it.

It’s all new to me you see, PHP and SQL.

Thanks for the reply!

Try the tutorial I posted. If it doesn’t help, let me know and either someone (or myself) will find another more detailed one, or I could possibly write one myself at some point.

Unfortunately I won’t be free except for a space of about 30mins tomorrow morning, up untill in around 19hours from this message as I have work but I will get round to it.

I read through it and didn’t really understand it.

Thank you for offering to help me, it’s really appreciated! :slight_smile:

Try this: Php/MySQL tutorial

I’ve just skimmed through but it covers alot of stuff. Prob more stuff than you’re actually ever going to need but yeah

Thank you! :slight_smile:

I don’t know how to edit, if I can.

But, is there any way to view the .php files on the browser, without having to upload it to my webhost?

Thanks!

Not without running a web-server at home with php installed. My suggestion is create a sub-domain or a directory for testing files.

Such as domain.com/test/file.php or sub.domain.com/file.php

Thanks!

I know this isn’t really the place, but is there any information on how to set-up a Dedicated Server at all?

Thanks!

You need money for one of them. Your other option is a VPS which still requires money, but is alot cheaper. You also have to consider which version of linux you want to use in it. Personally I use Ubuntu, but there is also fedora, CentOS, debian etc.

A good host I use for VPS hosting is Neosurge and There is a tutorial for setting it up with LAMP (Linux, Apache, MySQL and PHP) at Linode’s Library. Just remember because I use ubuntu, this guide is for ubuntu (10.04 to be exact)

Thanks!

I currently have one, hosted by 1&1.

It’s on CentOS :slight_smile:

Thanks again!

Sponsor our Newsletter | Privacy Policy | Terms of Service