This tutorial covers the following topics:
This tutorial explains how to create additional tables inside a database and add data inside the table.
How to create new tables
To create new tables inside a database, first open the phpMyAdmin tool, click on the Databases tab and click on the name of the desired database.
On the new page that opens you will see a list of all the current tables inside the database and a section named Create table. In that section, in the Name field you should input the desired new name of the table and then select the number of columns that the table should have via the Number of columns dropdown. When ready, click the Go button to create the table.
On the next page you can configure the structure of the columns in the new table. The different fields there are:
- Name - The name of the column;
- Type - The type of the data, which will be stored in the corresponding column. More details about the possible choices can be found in the official MySQL Data Types documentation;
- Length/Values - The length of the field;
- Default - With this option you can specify if the fields in the column would have a default value. This is useful for example if you want to have timestamps for the entries in each row;
- Collation - The data collation for each of the fields;
- Attributes - assign any special attributes to the fields;
- Null - Define whether the field value can be NULL. More about the NULL value can be found in the MySQL documentation;
- Index - Set the Index of the row. More information about the MySQL column indexes can be found in the MySQL documentation;
- A_I - Short for Auto Increment. If this option is enabled then the values in the fields of the column will be auto incremented;
- Comments - Here you can add comments, which will be included in the database SQL code.
After you configured the different columns, you should specify the Collation and Engine of the new table via their respective dropdowns.
When you are ready, click the Save button to create the new table.
How to Add Content in a Database Table
To add records inside a database table, open the table with phpMyAdmin and click the Insert tab.
Enter the desired data in the corresponding fields and click on the Go button to store it. You can see the newly inserted record by clicking on the Browse tab.