{"id":27501,"date":"2017-12-30T14:05:08","date_gmt":"2017-12-30T11:05:08","guid":{"rendered":"http:\/\/kamil-abzalov.com\/tutorials\/create-php-mvc-app-create-database\/"},"modified":"2020-04-11T00:02:19","modified_gmt":"2020-04-10T21:02:19","slug":"create-php-mvc-app-create-database","status":"publish","type":"post","link":"https:\/\/kamil-abzalov.com\/en\/tutorials\/phpmysql\/create-php-mvc-app-create-database\/","title":{"rendered":"Create php MVC app. Create database"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; fullwidth=&#8221;on&#8221; _builder_version=&#8221;3.22&#8243;][et_pb_fullwidth_header title=&#8221;Create php MVC app. Create database&#8221; _builder_version=&#8221;3.16&#8243; max_width_tablet=&#8221;50px&#8221; button_one_text_size__hover_enabled=&#8221;off&#8221; button_two_text_size__hover_enabled=&#8221;off&#8221; button_one_text_color__hover_enabled=&#8221;off&#8221; button_two_text_color__hover_enabled=&#8221;off&#8221; button_one_border_width__hover_enabled=&#8221;off&#8221; button_two_border_width__hover_enabled=&#8221;off&#8221; button_one_border_color__hover_enabled=&#8221;off&#8221; button_two_border_color__hover_enabled=&#8221;off&#8221; button_one_border_radius__hover_enabled=&#8221;off&#8221; button_two_border_radius__hover_enabled=&#8221;off&#8221; button_one_letter_spacing__hover_enabled=&#8221;off&#8221; button_two_letter_spacing__hover_enabled=&#8221;off&#8221; button_one_bg_color__hover_enabled=&#8221;off&#8221; button_two_bg_color__hover_enabled=&#8221;off&#8221;][\/et_pb_fullwidth_header][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; _builder_version=&#8221;3.22&#8243;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;0px|||&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_dcsbcm_divi_breadcrumbs_module homebreadcrumbtext=&#8221;Home&#8221; hide_currentbreadcrumb=&#8221;off&#8221; _builder_version=&#8221;3.0.92&#8243; custom_padding=&#8221;0px|||&#8221; hover_enabled=&#8221;0&#8243; fontsbreadcrumbs_font_size_tablet=&#8221;51&#8243; fontsbreadcrumbs_line_height_tablet=&#8221;2&#8243; fontsseperator_font_size_tablet=&#8221;51&#8243; fontsseperator_line_height_tablet=&#8221;2&#8243; fontsbreadcrumblinks_font_size_tablet=&#8221;51&#8243; fontsbreadcrumblinks_line_height_tablet=&#8221;2&#8243;][\/et_pb_dcsbcm_divi_breadcrumbs_module][et_pb_text _builder_version=&#8221;3.27.4&#8243; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]In <a href=\"\/en\/tutorials\/phpmysql-tuts\/create-simple-php-mvc-app-work-plan\/\">last lesson <\/a> we began to create our PHP MVC application. Today we will create database with phpmyadmin using.<br \/>\n[\/et_pb_text][et_pb_video src=&#8221;https:\/\/www.youtube.com\/watch?v=pPXgZmzQIhI&#8221; _builder_version=&#8221;3.0.92&#8243;][\/et_pb_video][et_pb_text _builder_version=&#8221;3.27.4&#8243; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]Our database will be consist of 5 tables:<\/p>\n<ul>\n<li>roles<\/li>\n<li>users<\/li>\n<li>orders<\/li>\n<li>products<\/li>\n<li>productsInOrders &#8211; linked table between products and orders.<\/li>\n<\/ul>\n<p>We will create links between tables. You can  see my <a href=\"\/en\/tutorials\/mysql-tuts\/mysql-links-between-tables-join-operator\/\">tutorial about links in mysql<\/a>. Why we must make links? Let&#8217;s imagine the situation &#8211; you have hot several users in database with some roles. If you remove role, user will lost his role &#8211; it will be violation in the data structure. That&#8217;s why you need to track any action with users or roles data. It&#8217;s clear that you can remove user, but it os not good to remove role, if any user has got this role. That&#8217;s why we will use links.<br \/>\nOne more feature, we will consider, MySQL functions. In users table we have got password column. But it is not a good practise to store original passwords in database. You must hash passwords. For this purpose MySQL has got MD5 function. PHP has got the same function. You must use all good capabilities to store any private data in your applications.<br \/>\nIn next lesson we will begin to write code.<br \/>\n[\/et_pb_text][et_pb_comments _builder_version=&#8221;4.4.2&#8243; custom_margin=&#8221;30px||||false|false&#8221; hover_enabled=&#8221;0&#8243;][\/et_pb_comments][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In last lesson we began to create our PHP MVC application. Today we will create database with phpmyadmin using. Our database will be consist of 5 tables: roles users orders products productsInOrders &#8211; linked table between products and orders. We will create links between tables. You can see my tutorial about links in mysql. Why [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[274,219],"tags":[248,240],"class_list":["post-27501","post","type-post","status-publish","format-standard","hentry","category-phpmysql","category-tutorials","tag-mysql-en","tag-php-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create php MVC app. Create database - Kamil Abzalov&#039;s blog<\/title>\n<meta name=\"description\" content=\"Today we will create database for our future PHP MVC application. For this purpose we will use phpmyadmin. It is very popular tool, which every hosting provider has.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create php MVC app. Create database - Kamil Abzalov&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"Today we will create database for our future PHP MVC application. For this purpose we will use phpmyadmin. It is very popular tool, which every hosting provider has.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0441\u0430\u0439\u0442 \u041a\u0430\u043c\u0438\u043b\u044f \u0410\u0431\u0437\u0430\u043b\u043e\u0432\u0430\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/kamabzalov\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-30T11:05:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-10T21:02:19+00:00\" \/>\n<meta name=\"author\" content=\"Kamil&#039; Abzalov\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Create php MVC app. Create database\" \/>\n<meta name=\"twitter:description\" content=\"Today we will create database for our future PHP MVC application. For this purpose we will use phpmyadmin. It is very popular tool, which every hosting provider has.\" \/>\n<meta name=\"twitter:creator\" content=\"@kamabzalov\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kamil&#039; Abzalov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/\"},\"author\":{\"name\":\"Kamil' Abzalov\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#\\\/schema\\\/person\\\/9c53360f21b83306ba40c2231573c600\"},\"headline\":\"Create php MVC app. Create database\",\"datePublished\":\"2017-12-30T11:05:08+00:00\",\"dateModified\":\"2020-04-10T21:02:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/\"},\"wordCount\":499,\"commentCount\":0,\"keywords\":[\"mysql\",\"php\"],\"articleSection\":[\"PHP+MySQL\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/\",\"url\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/\",\"name\":\"Create php MVC app. Create database - Kamil Abzalov's blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#website\"},\"datePublished\":\"2017-12-30T11:05:08+00:00\",\"dateModified\":\"2020-04-10T21:02:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#\\\/schema\\\/person\\\/9c53360f21b83306ba40c2231573c600\"},\"description\":\"Today we will create database for our future PHP MVC application. For this purpose we will use phpmyadmin. It is very popular tool, which every hosting provider has.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/videouroki\\\/phpmysql\\\/create-php-mvc-app-create-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\\\/\\\/kamil-abzalov.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create php MVC app. Create database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#website\",\"url\":\"https:\\\/\\\/kamil-abzalov.com\\\/\",\"name\":\"\u0441\u0430\u0439\u0442 \u041a\u0430\u043c\u0438\u043b\u044f \u0410\u0431\u0437\u0430\u043b\u043e\u0432\u0430\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kamil-abzalov.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kamil-abzalov.com\\\/#\\\/schema\\\/person\\\/9c53360f21b83306ba40c2231573c600\",\"name\":\"Kamil' Abzalov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g\",\"caption\":\"Kamil' Abzalov\"},\"sameAs\":[\"https:\\\/\\\/kamil-abzalov.com\\\/\",\"https:\\\/\\\/www.facebook.com\\\/kamabzalov\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/kamabzalov\",\"https:\\\/\\\/x.com\\\/kamabzalov\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/kamabzalov\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create php MVC app. Create database - Kamil Abzalov's blog","description":"Today we will create database for our future PHP MVC application. For this purpose we will use phpmyadmin. It is very popular tool, which every hosting provider has.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/","og_locale":"en_US","og_type":"article","og_title":"Create php MVC app. Create database - Kamil Abzalov's blog","og_description":"Today we will create database for our future PHP MVC application. For this purpose we will use phpmyadmin. It is very popular tool, which every hosting provider has.","og_url":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/","og_site_name":"\u0441\u0430\u0439\u0442 \u041a\u0430\u043c\u0438\u043b\u044f \u0410\u0431\u0437\u0430\u043b\u043e\u0432\u0430","article_author":"https:\/\/www.facebook.com\/kamabzalov","article_published_time":"2017-12-30T11:05:08+00:00","article_modified_time":"2020-04-10T21:02:19+00:00","author":"Kamil' Abzalov","twitter_card":"summary_large_image","twitter_title":"Create php MVC app. Create database","twitter_description":"Today we will create database for our future PHP MVC application. For this purpose we will use phpmyadmin. It is very popular tool, which every hosting provider has.","twitter_creator":"@kamabzalov","twitter_misc":{"Written by":"Kamil' Abzalov","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/#article","isPartOf":{"@id":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/"},"author":{"name":"Kamil' Abzalov","@id":"https:\/\/kamil-abzalov.com\/#\/schema\/person\/9c53360f21b83306ba40c2231573c600"},"headline":"Create php MVC app. Create database","datePublished":"2017-12-30T11:05:08+00:00","dateModified":"2020-04-10T21:02:19+00:00","mainEntityOfPage":{"@id":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/"},"wordCount":499,"commentCount":0,"keywords":["mysql","php"],"articleSection":["PHP+MySQL","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/","url":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/","name":"Create php MVC app. Create database - Kamil Abzalov's blog","isPartOf":{"@id":"https:\/\/kamil-abzalov.com\/#website"},"datePublished":"2017-12-30T11:05:08+00:00","dateModified":"2020-04-10T21:02:19+00:00","author":{"@id":"https:\/\/kamil-abzalov.com\/#\/schema\/person\/9c53360f21b83306ba40c2231573c600"},"description":"Today we will create database for our future PHP MVC application. For this purpose we will use phpmyadmin. It is very popular tool, which every hosting provider has.","breadcrumb":{"@id":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kamil-abzalov.com\/videouroki\/phpmysql\/create-php-mvc-app-create-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/kamil-abzalov.com\/en\/"},{"@type":"ListItem","position":2,"name":"Create php MVC app. Create database"}]},{"@type":"WebSite","@id":"https:\/\/kamil-abzalov.com\/#website","url":"https:\/\/kamil-abzalov.com\/","name":"\u0441\u0430\u0439\u0442 \u041a\u0430\u043c\u0438\u043b\u044f \u0410\u0431\u0437\u0430\u043b\u043e\u0432\u0430","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kamil-abzalov.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kamil-abzalov.com\/#\/schema\/person\/9c53360f21b83306ba40c2231573c600","name":"Kamil' Abzalov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ad2daebcb3a4d03f8573b49054a003cd26a151ecc58ccfccc75b823131d1ead?s=96&d=mm&r=g","caption":"Kamil' Abzalov"},"sameAs":["https:\/\/kamil-abzalov.com\/","https:\/\/www.facebook.com\/kamabzalov","https:\/\/www.linkedin.com\/in\/kamabzalov","https:\/\/x.com\/kamabzalov","https:\/\/www.youtube.com\/user\/kamabzalov"]}]}},"_links":{"self":[{"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/posts\/27501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/comments?post=27501"}],"version-history":[{"count":6,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/posts\/27501\/revisions"}],"predecessor-version":[{"id":31961,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/posts\/27501\/revisions\/31961"}],"wp:attachment":[{"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/media?parent=27501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/categories?post=27501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kamil-abzalov.com\/en\/wp-json\/wp\/v2\/tags?post=27501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}