{"id":19160,"date":"2015-12-29T02:01:08","date_gmt":"2015-12-28T16:01:08","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=19160"},"modified":"2015-12-29T11:25:15","modified_gmt":"2015-12-29T01:25:15","slug":"reservations-web-application-database-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/reservations-web-application-database-tutorial\/","title":{"rendered":"Reservations Web Application Database Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Reservations Web Application Database Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation_db.jpg\" title=\"Reservations Web Application Database Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Reservations Web Application Database Tutorial<\/p><\/div>\n<p>The part we start off on today with the continuation of our PHP Reservations web application, we started at with <a target=_blank title='Reservations Web Application Primer Tutorial' href='#rwapt'>Reservations Web Application Primer Tutorial<\/a> as shown below, relates to an &#8220;early days&#8221; look at a proposed MySql database structure we can use with our application.<\/p>\n<p>As we also said yesterday, we see the crux of a reservation system as needing a &#8230;<\/p>\n<ul>\n<li>timeline display mechanism &#8230; yesterday&#8217;s work<\/li>\n<li>a database of some sort &#8230; today&#8217;s work &#8230; and for the future &#8230; at the very least &#8230;<\/li>\n<li>reports of sorts<\/li>\n<li>a payment system gateway arrangement &#8230; if you want online bookings to be a possibility &#8230; though we may not be doing this, because our project is fictional<\/li>\n<\/ul>\n<p>We hope over time, at this blog, that we&#8217;ve imbued an enthusiasm and admiration for the combination of PHP and MySql &#8230; our <a target=_blank title='Fred and Ginger' href='https:\/\/www.youtube.com\/watch?v=YFI0rFFp8j8'>Fred and Ginger<\/a> functionality duo &#8230; and the <a target=_blank title='Edwatd Everett Horton' href='https:\/\/www.youtube.com\/watch?v=XpyKdVpxkM8'>Edward Everett Horton<\/a> of supporting acts &#8230; <a target=_blank title='phpMyAdmin' href='https:\/\/www.phpmyadmin.net\/'>phpMyAdmin<\/a>.<\/p>\n<p>MySql databases, in relation to PHP, are often seen as the &#8220;backend&#8221;, and it can be good for envisagement reasons and organizational reasons to compartmentalize a project into this &#8220;backend&#8221; (database) and &#8220;frontend&#8221; (web application).<\/p>\n<p>And so, in these early stages, it is debatable with design whether to work from the database &#8220;out&#8221; or the web application &#8220;in&#8221;, but either way, it is probably a database like MySql with the serverside language like PHP that will be needed to achieve the needs of a project like this with any commercial value.<\/p>\n<p>Plan ahead in these matters for whether any online payment (gateway) system arrangement fits in with your plans.  There are also &#8220;out of the box&#8221; ways to approach this, especially with PHP, as well, that some search engine searches could soon uncover.<\/p>\n<p>Please know we are only advising on the gist of some of the components that go into such a job, but there are loads and loads of different approaches to trying to achieve all this.<\/p>\n<p>So here is some SQL (that starts with &#8220;use users;&#8221; (ie. our database is called <i>users<\/i> but you can call it what suits your project) you could use with MySql to follow up the phpMyAdmin interactive bits &#8230;<\/p>\n<p><code><br \/>\ncreate database users CHARACTER SET = utf8 COLLATE = utf8_bin;<br \/>\ncreate user 'stay_user'@'localhost' IDENTIFIED BY 'password';<br \/>\n<\/code><\/p>\n<p> &#8230; you could call <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation.sql_GETME\" title=\"reservation.sql\" target=\"_blank\">reservation.sql<\/a> that can be executed with MySql command line or, like we did with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation_db.jpg\" title='Tutorial picture'>tutorial picture<\/a>, interactively, in a phpMyAdmin SQL window &#8230; cute, huh?!<\/p>\n<p>To not create the database in the same SQL as with the table creation SQL is a good security measure that many eCommerce and blog installations make use of, so that this whole set of procedures is not too automatic &#8230; (that a robot could do it) &#8230; <a target=_blank title='?' href='https:\/\/www.google.com.au\/search?q=not+that+there%27s+anything+wrong+with+that+robot&#038;ie=utf-8&#038;oe=utf-8&#038;gws_rd=cr&#038;ei=iJGAVuOBFOG2mwWX5pyYDw#q=%22not+that+there%27s+anything+wrong+with+that%22+robot'>&#8220;not that there&#8217;s anything wrong with that&#8221;<\/a>.<\/p>\n<p>We&#8217;ll be back with more as time goes on.<\/p>\n<hr>\n<p id='rwapt'>Previous relevant <a target=_blank title='Reservations Web Application Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/reservations-web-application-primer-tutorial\/'>Reservations Web Application Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Reservations Web Application Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation.jpg\" title=\"Reservations Web Application Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Reservations Web Application Primer Tutorial<\/p><\/div>\n<p>We&#8217;re setting off on what could be a long running project to construct a PHP Reservations web application today.<\/p>\n<p>We see the crux of a reservation system as needing a &#8230;<\/p>\n<ul>\n<li>timeline display mechanism &#8230; today&#8217;s work &#8230; and for the future &#8230; at the very least &#8230;<\/li>\n<li>a database of some sort<\/li>\n<li>reports of sorts<\/li>\n<li>a payment system gateway arrangement &#8230; if you want online bookings to be a possibility &#8230; though we may not be doing this, because our project is fictional<\/li>\n<\/ul>\n<p>So with the &#8220;timeline display mechanism&#8221; let&#8217;s use a Google Chart Timeline Chart which we &#8230;<\/p>\n<ul>\n<li>first mentioned with <a target=_blank title='PHP\/Javascript\/HTML Google Chart Timeline Chart Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-google-chart-timeline-chart-tutorial\/'>PHP\/Javascript\/HTML Google Chart Timeline Chart Tutorial<\/a><\/li>\n<li>last mentioned with <a target=_blank title='Google Chart Select Event Calendar Timeline Post Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-select-event-calendar-timeline-post-tutorial\/'>Google Chart Select Event Calendar Timeline Post Tutorial<\/a><\/li>\n<\/ul>\n<p>So here is the PHP source code you could call <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation.php-GETME\" title=\"reservation.php\" target=\"_blank\">reservation.php<\/a> and it was changed from the Timeline Chart code as per <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation.php-GETME\" title=\"reservation.php\" target=\"_blank\">this link<\/a>.  Here is a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/TimelineChart\/reservation.php\" title='Click picture'>live run<\/a> link, as well.<\/p>\n<p>We&#8217;ll be back with more.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d19141' onclick='var dv=document.getElementById(\"d19141\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/timeline\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d19141' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d19160' onclick='var dv=document.getElementById(\"d19160\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mysql\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d19160' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The part we start off on today with the continuation of our PHP Reservations web application, we started at with Reservations Web Application Primer Tutorial as shown below, relates to an &#8220;early days&#8221; look at a proposed MySql database structure &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/reservations-web-application-database-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12,19,31,37],"tags":[299,519,1765,827,910,932,938,997,999,1764,1763,1729],"class_list":["post-19160","post","type-post","status-publish","format-standard","hentry","category-database","category-elearning","category-installers","category-projects","category-tutorials","tag-database-2","tag-google-charts","tag-job","tag-mysql","tag-payment-gateway","tag-php","tag-phpmyadmin","tag-programming","tag-project","tag-reporting","tag-reservations","tag-timeline"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/19160"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=19160"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/19160\/revisions"}],"predecessor-version":[{"id":19178,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/19160\/revisions\/19178"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=19160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=19160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=19160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}