Home
/
phpMyAdmin Tutorials
/
phpMyAdmin Create And Populate Tables Tutorial

phpMyAdmin Create And Populate Tables Tutorial

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, 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, 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 drop-down. When ready, click on Go 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 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 when 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 add comments, which will be included in the database SQL code.

After you configured the different columns, specify the Collation and Engine of the new table via their respective drop-downs.

When ready, click on Save 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 on the Insert tab.

Enter the desired data in the corresponding fields and click on Go to store it. You can see the newly inserted record by clicking on the Browse tab.

Share This Article