
Before you can set up a database table you will need to Set Up Database And Database user . Setting up a simple database table is not very hard with PhpMyAdmin. Follow along as I take you through the steps.
Step 1
If you haven’t already you will need to setup a database and a database user, if you don’t know how check out this article about Setting up a database and database user with Cpanel.
Log into your Cpanel hosting account. Usually you would just go to your https://yourdomainname.com/cpanel and enter your username and password.
Find then click this icon in your cpanel.
Step 2
PhpmyAdmin will open. On the left side will be a list of your databases. My database is called exampler_example. Click on your database name.
Step 3
Now that the database is open you can see there are no tables in it since it says No tables found In database. Other wise you would see a list of tables. Now just enter the name of your database table that you want. If you have user data that will be going in there you could type users or people or whatever you want to give you a reference to what kind of data will be stored in there.
For simplicity I’m going to name my table users. Now you need to know what kind of information about the users that you want to store in there. I’m going to store first names , last names and email addresses . I am going to need 3 columns plus 1 more column for their ids which will make 4 columns total. In the name box type users since that’s the name of the table we are making and where it says number of columns set it to 4 then click the go button.
Step 4
As you can see we have four rows which represents the columns of our database table. Since I have already chosen my column names I’m going to enter them in the boxes under where it says Name. The first box I will put id , the next box under Name I will put first_name , then last_name then email_address.
Step 5
We need to set the id column to PRIMARY. Where it says index there is a drop down selector that lets you select the index for your column. Set it to PRIMARY. You will get a popup and just click the go button on the popup.
Now next to Index it will say A_I which stands for Auto Increment, just click the check box
Leave a Reply