Tip:
Highlight text to annotate it
X
Setting up a PHP Database using cPanel
This movie will show you how to create
a new database using the cPanel that comes with your web hosting.
When you log into your t.server cPanel make sure you use https:// (not plain http://)
The "s" stands for secure. Use our first name
and your last initial
dot "t" (for Tom) dot "southcentral" dot "edu"
and then colon ":" two zero eight three
That will open up a specific port on the secure server.
You should get a page that looks similar to this.
If you scroll down, you'll see the database
section. You can click on the MySQL Database icon.
Either the MySQL databases or the Databases Wizard
which gives you the same information but a step at a time.
They also have a nice video
tutorial to show you how to use this, it will be similar to what I'm showing you here.
Step 1: Create a new database.
You can call it what you like but make it descriptive.
Use the "go back" button. You'll see that our databases have
your user name in the front,
underscore "_" and the database name you used.
Step 2 - Set up a user for this database.
For the userName, this is NOT the user name to the cPanel.
This will be the user name for the database. Make certain you keep these separate!
Use a basic username and a good password (characters, numbers, some upper case, and at least one special character.)
Write this information down and label it: Database login information.
Click on "Create the User" link.
Use the "Go Back" button.
Step 3 - Connect the username and the database together.
Click on the Add button.
Select "All Privileges". (If you don't see this screen go back and do Step 3 connecting the database with the username.
Click on "Make Changes"
Click on the "Go Back" button.
Write these things down because you are going to need them in the future.
You will need this information while you are working with your code.
Write down your database name, the user name, and the password.
Label this: mySQL Login Information.
Importing Data into the New Database
In order to use the new database you have to add a table with data
I've exported an existing table
with data in it. This will save you time.
Open up your cPanel. Scroll down to the Database section.
Click on the PHPMyAdmin icon.
You'll see over on the left hand side, where the database is listed.
So click on that.
Your prefix will be your own user name.
Instead of creating a new table from scratch,
you can do an import, browse to where you downloaded the file from the Learning Activities.
The table you downloaded will probably
be named pageData.sql,
This is the SQL file that
was exported from the table I set up earlier.
If you want to see what that looks like you can look at pageDataStructure.pdf
and you can see that the pageData table
is basically going to be all text type fieldsm
There will be a page section
a header section, several miscellaneous fields, and an item.
We will look at that data in just a minute.
For now, we will just
select that text SQL file and click on go (in the lower right-hand corner of the page.
You will see that you imported 8 records.
Look at the structure, by clicking on the "Structure" tab
and you can see the page field
It will either be an activity or a career. We will be focusing on the career entries.
Here's the header field, the infor that will display on the top of each article
and the different fields.
You'll see this data in use more as we get into the programming of the pages.
End of Part I - Web Explorations.