{"id":447,"date":"2017-02-19T14:33:46","date_gmt":"2017-02-19T14:33:46","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=article&#038;p=447"},"modified":"2020-03-25T14:42:27","modified_gmt":"2020-03-25T14:42:27","slug":"creating-database-tables-phpmyadmin","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/creating-database-tables-phpmyadmin\/","title":{"rendered":"How to Create a Database Table With phpMyAdmin"},"content":{"rendered":"<p>In this tutorial, we&#8217;ll show you how to create a database table with phpMyAdmin. We&#8217;ll assume that you are already logged into phpMyAdmin. If you are not logged in just follow the <a href=\"https:\/\/chemicloud.com\/kb\/article\/how-to-use-phpmyadmin\/\" target=\"_blank\" rel=\"noopener noreferrer\">steps in\u00a0this tutorial<\/a>\u00a0to login.<\/p>\n<p><strong>1)<\/strong> First, we&#8217;ll need to select the database, in this example, we&#8217;ll use the <strong>chemiclo_demo<\/strong>\u00a0database.<\/p>\n<p><strong>2)<\/strong> You&#8217;ll notice that we have a couple of test tables already created, to create a new database table just enter the name of the table in the &#8220;<strong>Name<\/strong>&#8221; field and\u00a0the number of fields you want for this table and click &#8220;<strong>Go&#8221;<\/strong>.<\/p>\n<p><strong>3)<\/strong> We&#8217;ve created the table &#8220;demo&#8221; and added two columns (name and phone),\u00a0now we need to set the details of each field within this\u00a0new table and select <strong>Type<\/strong> of data the column will hold. \u00a0Some of the most \u00a0common types are:<\/p>\n<p><strong>INT = <\/strong>INTEGER &#8211; used to store a number that can be written without a fractional component. (e.g. 2, 10, -44). An integer can be zero, positive, and negative.<br \/>\n<strong>CHAR<\/strong> = Characters &#8211; used to store character string value of fixed length, the maximum number is of characters is 255.<br \/>\n<strong>VARCHAR<\/strong> = Variable Length Characters &#8211; used to store variable length alphanumeric data and can store up to\u00a065,535 characters.<br \/>\n<strong>TEXT<\/strong> = used for holding large amounts of text.<br \/>\n<strong>DATE<\/strong> = Will only hold dates.<br \/>\n<strong>DATETIME<\/strong> = Will hold both a date and a time.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" style=\"height: 371px; width: 720px;\" src=\"https:\/\/chemicloud.com\/updata\/_editor\/images\/phpmyadmin_create_database_table1.png\" alt=\"\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>4) We can also define the <strong>Length\/Values<\/strong> if necessary, the CHAR type will require you to specify the maximum number of characters allowed. All the other fields are\u00a0optional, however, if you need more detailed information about all the options available you can check the <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/create-table.html\" rel=\"nofollow noopener\" target=\"_blank\">MySQL\u00a0Reference Manual<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>5)<\/strong> When finished, click &#8220;<strong>Save&#8221;.<\/strong>\u00a0 A message will appear indicating that your table has been created.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we&#8217;ll show you how to create a database table with phpMyAdmin. We&#8217;ll assume that you are already logged into phpMyAdmin. If you are not logged in just follow the steps in\u00a0this tutorial\u00a0to login. 1) First, we&#8217;ll need to select the database, in this example, we&#8217;ll use the&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[38],"ht-kb-tag":[122,124,126],"class_list":["post-447","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-mysql","ht_kb_tag-database","ht_kb_tag-phpmyadmin","ht_kb_tag-table"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=447"}],"version-history":[{"count":3,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/447\/revisions"}],"predecessor-version":[{"id":2131,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/447\/revisions\/2131"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=447"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}