<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abiodun Adetona on Medium]]></title>
        <description><![CDATA[Stories by Abiodun Adetona on Medium]]></description>
        <link>https://medium.com/@Adetona77?source=rss-7152f1aa2c4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pCPnc2NCWphhV9fuk0nL7g.jpeg</url>
            <title>Stories by Abiodun Adetona on Medium</title>
            <link>https://medium.com/@Adetona77?source=rss-7152f1aa2c4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:18:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Adetona77/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How middleware works in Expressjs(And How to create one.)]]></title>
            <link>https://medium.com/@Adetona77/how-middleware-works-in-expressjs-and-how-to-create-one-4e366ccd28f9?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e366ccd28f9</guid>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[node-for-begginners]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Wed, 07 Aug 2019 16:07:59 GMT</pubDate>
            <atom:updated>2019-08-07T16:07:59.585Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>What is Middleware?</strong></h4><p>Middleware are functions that have access to the <a href="http://expressjs.com/en/4x/api.html#req">request object,</a> <a href="http://expressjs.com/en/4x/api.html#res">response object</a>, and the next function in an application’s request-response cycle.</p><p>Well, putting it simply;</p><p>Middleware are functions that act in the middle of an incoming request.</p><p>For example, if you want to check if a user is authenticated before giving her access to a route. You create a middleware to act in the middle of that request to check if the user has been authenticated or not.</p><p>Note that, Middleware are not limited to authentication. You can use them to serve favicon, like <a href="https://expressjs.com/en/resources/middleware/serve-favicon.html">this</a> or handle cookies, like <a href="https://expressjs.com/en/resources/middleware/cookie-session.html">this.</a></p><p>This brilliant diagram from the guys at <a href="http://expressjs.com/">http://expressjs.com/</a> can further help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uwNmNlj_t6NSVLULu3R5ug.png" /><figcaption>image source: <a href="http://expressjs.com/">http://expressjs.com</a></figcaption></figure><p>Now let’s move on to create an example of a Middleware and see how it actually works.</p><h4>How to create a middleware.</h4><p>This article takes into consideration that you have set up Node and Express on your machine already. If not, you can learn how to do that <a href="https://www.robinwieruch.de/node-js-express-tutorial/">here</a>.</p><p>We are building a basic middleware that logs the current date on every incoming request.</p><pre>//Our middleware function. <br>function currentTime(req, res, next) {<br>  var date = new Date()<br>  console.log(date)<br>  next(); <br>}</pre><p>You can see middleware is basically a function. You can create anything with it.</p><pre>//invoke the middleware globally in the app. <br>app.use(currentTime);</pre><p><em>app.use</em> gets called every time a request is made to the server.</p><p>The example above will work on every request made to the server because we did not specify a route.</p><p>We can specify a route by doing this:</p><pre>//invoke the middleware in the log route<br>app.use(‘/log’, currentTime);</pre><p>For example, if you make a request to the /<em>log route</em>, you will see the current time logged in your console.</p><p>Try this:</p><pre>app.get(&#39;/log&#39;, (req, res)=&gt;{<br>  res.json({&#39;message&#39;: &#39;Check your console to see current date&#39;});<br>})</pre><p>Another way to call your middleware function is by doing that directly in your route setup. You can do away with <em>app.use.</em></p><pre>app.get(&#39;/log&#39;, currentTime,  (req, res)=&gt;{<br>  res.json({&#39;message&#39;: &#39;Check your console to see current date&#39;});<br>})</pre><p>That’s it on Middleware.</p><p>Looking forward to sharing more and more in the future.</p><p>Follow me on twitter for future updates: <a href="https://mobile.twitter.com/Adetona77">@Adetona77</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e366ccd28f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Books of 2017]]></title>
            <link>https://medium.com/benjamin-dada/my-books-of-2017-94e38b6256f5?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/94e38b6256f5</guid>
            <category><![CDATA[benjamin-dada]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[abiodun-adetona]]></category>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Thu, 28 Dec 2017 14:35:24 GMT</pubDate>
            <atom:updated>2017-12-28T15:03:24.289Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ok_kNj2wTW690P0oTV2Gg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/6jYoil2GhVk?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Aaron Burden</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>This year I read about a dozen books and here is a summary.</p><p>It was interesting to read about the life of some great figures I’ve always admired like Elon Musk and Steve Jobs. Also, reading about human history was fun!</p><p>In this post, I write a little about some of my favourites which I grouped into 4 categories: (auto)biographies, personal development, history and others.</p><h3>A. (Auto)Biographies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*zn6m5072BVEvveLsj1ph9Q.jpeg" /><figcaption>The 4 (auto) biographies I read</figcaption></figure><p>I read more Autobiographies than any other book categories this year. These 4 look like something I will re-read soon. They were written about Nelson Mandela, Elon Musk, Alex Ferguson and Steve Jobs.</p><h4>1. Long Walk to Freedom: The Autobiography of Nelson Mandela</h4><p>A raw narration of the evil of apartheid government in South Africa and the life of Mandela written by Nelson Mandela.</p><p>If you are looking for a good book to read on the history of Mandela and the struggles of the black race during apartheid rule in South Africa, this should be the first book to read.</p><p>This book is more than just a history book, it’s a story of courage, persistence and how freedom is important to the progress of any society.</p><p>This is a long read of over 600 pages so be ready to take a <em>long walk </em>into the life of Nelson Mandela and a lot happenings during the South Africa <em>fight for freedom on their own soil.</em></p><h4>2. Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future by Ashlee Vance.</h4><p>A fascinating biography on the life of Elon Musk, so far.This book made me understand Elon better.</p><p>This is a book about Elon’s upbringing, his lifestyle and how he got to where he is now. His ambitious plans for the future will prove quite interesting. Especially his future plan for Mars colonization.</p><p>If you are looking for motivation from a “crazy” person, then, Elon is a perfect example. He thinks big and does big things.</p><h4>3. Alex Ferguson: My Biography by Alex Ferguson.</h4><p>A great read on the life of Alex Ferguson; the greatest football manager (to me).</p><p>It’s a look into his management of Manchester United during his 26 years stay at the club. His success is not all about lucky and perfect timing but due to his outstanding managerial skill.</p><p>Managing a top club for over 20 years is not an easy feat to achieve. I doubt any football manager has stayed with a single club for that long with the same level of success recorded by Alex Ferguson.</p><p>This is a nice book to read on management, even if you are not into football.</p><h4>4. Steve Jobs by Walter Isaacson</h4><p>Everything about how Apple started, Steve Jobs rise to stardom and how he bottled it up and came back afterward.</p><h3>B. Personal Development</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*nVK-qJAKLTWcb-K5hy544Q.jpeg" /><figcaption>Figure 2: The books on Personal Development I read in 2017</figcaption></figure><h4>1. The War Of Art By Steven Pressfield</h4><p>This is one of the most impactful books I read in 2017. It’s a wake-up call to do what you love doing and never procrastinate on doing what matters.</p><p>Steven Pressfield offers some effective tips on fighting procrastination in your work.</p><p>There are so many gems in this book. This is one of my favorites:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*iwcJdu3ELl57CgdnwUYkPw.jpeg" /><figcaption>Figure 3: Excerpt from The War of Art</figcaption></figure><h4>2. Linchpin: Are You Indispensable By Seth Godin.</h4><p>Being a long fan of the <a href="http://sethgodin.typepad.com/">Seth’s blog</a>, I enjoyed reading this book . This is an extension of his short blog posts.</p><p>Seth writes on how to create value in today’s world. Some of the words in this book are spot-on and you will feel connected to them if you are a frequent reader of his blog.</p><h4>3. The Power of Habit: Why We Do What We Do in Life and Business by Charles Duhigg.</h4><p>Thought this was yet another book on changing your life overnight. It was different.</p><p>Charles offers some actionable tips on adopting a new habit and dropping the bad ones. What makes this book stands out for me is that most of the tips in it are backed up by research and stories, not just some random suggestions.</p><h3>C. History</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*hx9jKsvZvc_ph0INs6pF0Q.jpeg" /></figure><h4>1. Sapiens: A Brief History of Humankind by Yuval Noah Harari.</h4><p>I can’t get my head around some history books but Yuval made it so simple and memorable. Yuval tells the human history right from being a not so powerful animal till we became the most intelligent on the planet.</p><p>I highly recommend this book especially if you are interested in how human got here.</p><h3>D. Others</h3><p>There are 5 more I wish I could write about. They include:</p><ul><li><em>Zero to One</em> by Peter Thiel</li><li><em>ReWork: Change the Way You Work Forever</em> by Jason Fried and DHH.</li><li><em>Guns, Germs, and Steel</em> by Jared Diamond</li><li><em>Losing My Virginity: How I’ve Survived, Had Fun, and Made a Fortune Doing Business My Way</em> by Richard Branson</li><li><em>The laws of simplicity</em> by John Maeda</li></ul><h3>Going forward: 2018</h3><p>Most of what I read this year are from <a href="https://sivers.org/book">this</a> great resource by Derek Sivers. I will continue exploring the list for my 2018 reads, Patrick Collison also has a decent <a href="https://patrickcollison.com/bookshelf">bookshelf</a>.</p><p>My reading pattern won’t change much in 2018 except the addition of sci-fi books to my reading list.</p><p>See you in 2018.</p><p>— Biodun</p><p><a href="https://medium.com/u/891aedd362e6"><em>Benjamin Dada, MSc.</em></a><em> helped in editing this post and make it fit for this publication. If you have future stories for this publication reach out. Links in Medium Bio.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94e38b6256f5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/benjamin-dada/my-books-of-2017-94e38b6256f5">My Books of 2017</a> was originally published in <a href="https://medium.com/benjamin-dada">Write</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Re-cap: Building a viral app in 48 hours]]></title>
            <link>https://medium.com/benjamin-dada/re-cap-building-a-viral-app-in-48-hours-909bd72c06e2?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/909bd72c06e2</guid>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Tue, 04 Apr 2017 16:29:51 GMT</pubDate>
            <atom:updated>2017-04-12T13:27:36.314Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xZN-0gw6Vg6l_XWu.png" /><figcaption>Landing page of keepthechangebruh.com.ng</figcaption></figure><p>This post is a summary of what I’ve been upto the past 5 days, building a <a href="http://keepthechangebruh.com.ng/">web app</a> for the #keepthechangeBruh trend. It all started when <a href="https://medium.com/u/891aedd362e6">Benjamin Dada</a> sent out a tweet requesting a frontend developer to build an app.</p><h3>Benjamin Dada on Twitter</h3><p>Any front end guy awake ATM? Please DM. Let&#39;s build this ish.</p><p>My first impression was that it’s a job offer so I chipped in even though, I’m not a frontend developer but in the spirit of improving myself I decided to take up the challenge.</p><h3>Abiodun Adetona on Twitter</h3><p>@dadaben_ Let&#39;s talk.</p><p>After approaching <a href="https://medium.com/u/891aedd362e6">Benjamin Dada</a>, he explained what he is trying to build. Initially, I thought the idea was crazy but I got excited because in the end it will help me become a better coder.</p><p>Since #KeepThechangeBruh is a trending topic we had to be very quick in building the MVP. I started building on the design made by <a href="https://medium.com/u/79949e506a52">Early Attoh</a> (Our UI designer) in that same night I talked to Ben.</p><p>I finished the initial frontend in a day and <a href="https://medium.com/u/5c5f962e9d39">Adewale Abati</a> (a more experienced back-end developer) came around to add some functionality to the app. The whole team was not happy with the look and feel of the app. At that point, we had to enlist the help of <a href="https://medium.com/u/cbbba08957d0">Yomi</a> (a kick-ass front-end developer) to build on what I had done so far.</p><p>He was really fast and finished the whole polishing in just a night making it look more like the original design spec. With this, we were happy to launch it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGmXB5Bt2lKnISEg8TI28A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SBu2WQfBf3P0DNnq_v4zrw.png" /><figcaption>Left; Early’s UI Design and Right Yomi’s Front-end Design</figcaption></figure><p>Although, the trend was subsiding, that didn’t affect the moral of the team who had already gone ahead to purchase a domain name for the app.</p><p>Thanks to <a href="https://medium.com/u/891aedd362e6">Benjamin</a>’s excellent management and push to launch at least a first version of the app, it happened.</p><h3>5kBae on Twitter</h3><p>Hi everyone, Today we are set to announce the launch of a fun service that allows you find out how much change you can get on a date. 1/</p><p>After the launch, we were all relieved. Now, it was time to gain traction. Having missed the opportunity to gain traction organically as at when the trend was still hot and people were actively searching the hashtag. Unfortunately, a football match was on-going that day and as such people were more focused on tweeting about the match. Therefore, we had to start messaging people directly to try out the app.</p><p>Finally, it started gaining traction.</p><blockquote>We want to believe that what helped us gain traction was the social integration on the last screen of the app. Where people could share their results on Twitter. E.g</blockquote><h3>Abiodun Adetona on Twitter</h3><p>Lol! I can keep ₦15,790 change on a ₦50,000 date. Check yours now https://t.co/jXLhSuOI7I #KeepTheChangeBruh #5kBae via @keepdchangebruh</p><p>To our amazement, in just 3 hours…The app saw 1000 pageviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*SSQc9yOxYJxkfRgK.jpg" /></figure><p>I was really surprised and at that point I felt relieved and I am starting to think that my dream of <em>building something people would actually use</em> could be a reality<em>.</em> Even though it might be trivial, I’m actually glad to be a part of something people are interested in using.</p><p>Above all , I’ve learnt a lot in 48 hours of building the app and look forward to building more amazing thing.</p><p>It was a privilege to work with people like Ace (a badass developer), Ben (a top manager), Yomi (He actually knows what he is doing when it comes frontend) and Early (A creative designer).</p><p>Thanks to those who have started contributing to the codebase on <a href="https://github.com/Adetona/keepthechange/">github</a>. I didn’t really expect that people would be interested in contributing to something of this nature.</p><p>Thanks, <br>Biodun.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=909bd72c06e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/benjamin-dada/re-cap-building-a-viral-app-in-48-hours-909bd72c06e2">Re-cap: Building a viral app in 48 hours</a> was originally published in <a href="https://medium.com/benjamin-dada">Write</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding CRUD : How to Read , Update & Delete a record in the Database using PHP (The End).]]></title>
            <link>https://medium.com/@Adetona77/understanding-crud-how-to-read-update-delete-a-record-in-the-database-using-php-the-end-bd76b0861e8b?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd76b0861e8b</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Sat, 14 Jan 2017 06:50:32 GMT</pubDate>
            <atom:updated>2017-01-14T06:50:32.973Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding CRUD : How to Read , Update &amp; Delete a record in the Database using PHP (The End).</p><p>This is the last part of Understanding Crud in PHP , you can go through the previous parts <a href="https://medium.com/@Adetona77/understanding-crud-using-facebook-as-the-study-case-part-1-c4183cdf617a#.8ihl6k5ga">here</a> and <a href="https://medium.com/@Adetona77/understanding-crud-building-a-simple-application-for-storing-customer-records-using-php-30d58878fcf4">here</a>.</p><p>This part will focus on READ , UPDATE &amp; DELETE using PHP.</p><p>Let’s get started.</p><p><strong>READ.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*ccDHVM_AUAwnB03OZAx1dg.png" /></figure><p>Read simply means viewing of data stored in the database.</p><p>We’ve learnt how to insert the record in the PART 2 , the next step in CRUD is how to view the data stored and present it into a readable form.</p><p>Here is the code for viewing the data :</p><pre>&lt;?php </pre><pre>require_once (&#39;config.php&#39;) ; </pre><pre>$query = “SELECT * FROM customerdb” ;</pre><pre>$result = mysqli_query ($conn , $query) ;</pre><pre>while ($row = mysqli_fetch_array ($result) ) {<br> <br>echo ‘&lt;tr&gt;’ ;</pre><pre>echo ‘&lt;td&gt;’.$row [‘Name’]. ‘&lt;/td&gt;’ ;</pre><pre>echo ‘&lt;td&gt;’ .$row [‘Email’]. ‘&lt;/td&gt;’ ;</pre><pre>echo ‘&lt;td&gt;’ .$row [‘Number’]. ‘&lt;/td&gt;’ ;</pre><pre>echo ‘&lt;td&gt;’ .$row[‘Location’]. ‘&lt;/td&gt;’ ;</pre><pre>echo ‘&lt;td&gt;’. ‘&lt;a href=”edit.php?edit=’.$row [‘ID’].’” &gt; Edit &lt;/a&gt;’.’&lt;/td&gt;’ ;</pre><pre>echo ‘&lt;td&gt;’. ‘&lt;a href=”index.php?Delete=’.$row [‘ID’].’” &gt; Delete &lt;/a&gt;’.’&lt;/td&gt;’ ;</pre><pre>echo ‘&lt;tr&gt;’ ;</pre><pre>}</pre><pre>echo ‘&lt;/tr&gt;’ ;</pre><pre><br>?&gt; </pre><p>There are two main points worth of discussing in this part :</p><pre>1. $query = “SELECT * FROM customerdb” ;</pre><p>SELECT is an SQL command used for selecting columns in a table and the asterisk(*) that followed it means <strong>ALL</strong> which means that it should select all the columns in the table.</p><p>We can limit the columns to be selected by removing the * (ALL) and insert the columns we want to select.</p><p>E.g. If all you wanted is the Email column you just remove the * and put Email. You will have something like this :</p><pre><strong>  $query = “SELECT Email FROM customerdb” ;</strong></pre><pre>2. $row = mysqli_fetch_array ($result)</pre><p><a href="http://php.net/manual/en/mysqli-result.fetch-array.php">mysqli_fetch_array</a> is a function in PHP used to fetch the result of a row into an array. In this case <em>$row</em> has been converted into an array and will be used to present our records.</p><p><strong>UPDATE.</strong></p><p>update means to edit.</p><p>After storing a record and you made a mistake during the process the easiest thing to do next is to edit your mistake.</p><p>Here is how to update your record in mysql using PHP.</p><pre>&lt;?php</pre><pre>require_once (‘config.php’) ;</pre><pre>if (isset ($_GET [‘edit’]) ) {</pre><pre>//Checking If the user has submitted the form</pre><pre>if (isset ($_POST [‘submit’] )) {</pre><pre>//checking If the user has completely fill all the form field</pre><pre>if ( isset ($_POST [‘Name’] , $_POST [‘Email’] ,$_POST [‘Number’] ,$_POST [‘Location’] ) ) {</pre><pre>$ID = $_GET [‘edit’] ;</pre><pre>/*<br>mysqli_real_escape_string is for security purpose. It is used for escaping special characters inserted by the user which can sometimes be harmful to our database <br>*/ <br> <br>$Name = mysqli_real_escape_string ($conn , $_POST [‘Name’]) ;</pre><pre>$Email = mysqli_real_escape_string ($conn , $_POST [‘Email’]) ; <br> <br>$Number = mysqli_real_escape_string ($conn , $_POST [‘Number’]) ;</pre><pre>$Location = mysqli_real_escape_string ($conn , $_POST [‘Location’]) ;</pre><pre>//Inserting the submitted data into the database.</pre><pre>$sql = “UPDATE `customerdb` SET Name = ‘$Name’ , Email = ‘$Email’ , Number= ‘$Number’ , Location = ‘$Location’ WHERE (`ID` = ‘$ID’)” ;</pre><pre>if (mysqli_query ($conn , $sql) ) {<br> <br>$msg = “Successfully edited” ; <br> <br>}</pre><pre>else {</pre><pre>$msg = “oops! There is an error when editing your record. Retry again”.mysqli_error ($conn) ; <br> <br>} <br>}</pre><pre>}</pre><p>This part is straight forward because you only need a single query to get the job done.</p><pre>$sql = “UPDATE `customerdb` SET Name = ‘$Name’ , Email = ‘$Email’ , Number= ‘$Number’ , Location = ‘$Location’ WHERE (`ID` = ‘$ID’)” ;</pre><p>The only thing you need is to <strong>SET</strong> the required column you want to edit.</p><p>Here we have Name , Email , Number &amp; Location.</p><p>The WHERE clause is required because it gives the pointer of which record is to be edited. Since the ID is the unique column that’s why it is the most approriate to be used.</p><p><strong>DELETE.</strong></p><p>Delete simply means removing.</p><p>Once you delete a record you can’t recover it again.</p><p>Here is the code for deleting a record.</p><pre>$query = “DELETE FROM customerdb WHERE (ID = ‘$ID’)” ;</pre><p>That’s the command required to delete a record but you must be careful when deleting a record without adding the ‘WHERE’ clause because you can delete every record in a table without the clause.</p><p>That bring us to the end of UNDERSTANING CRUD in php.</p><p>You can view the Github code <a href="https://github.com/Adetona/Crud-tutorial">here</a></p><p>See you later. Thanks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd76b0861e8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding CRUD : Building a simple application for storing customer records using PHP. (PART 2)]]></title>
            <link>https://medium.com/@Adetona77/understanding-crud-building-a-simple-application-for-storing-customer-records-using-php-30d58878fcf4?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/30d58878fcf4</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Thu, 05 Jan 2017 16:44:31 GMT</pubDate>
            <atom:updated>2017-01-05T16:44:31.575Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Understanding CRUD : Building a simple application for storing customer records using PHP. (PART 2)</strong></p><p>Happy new year guys.</p><p>This is my first post in 2017 and it’s the continuity of the tutorial I started In 2016 about CRUD operation.</p><p>The PART 1 illustrates how the explain how CRUD works using some of what we do on Facebook as an example.</p><p>You can read about it <a href="https://medium.com/@Adetona77/understanding-crud-using-facebook-as-the-study-case-part-1-c4183cdf617a#.11nhv6bt8">here</a>.</p><p>This tutorial will focus on how you can perform CRUD operations using PHP &amp; MYSQL.</p><p>Now , let’s begin.</p><p><strong>Overview.</strong></p><p>I will be building a simple application for collecting customer records using mysql and php.</p><p>As you’ve learnt in the PART 1 , the C in CRUD stands for CREATING which means Inserting data into a database.</p><p>We will be dealing with CREATING in this tutorial.</p><p>First of all , we have to create the Database for storing the customer records before doing anything else.</p><p>The database is like the <em>‘storage tank’ </em>for everything you will be collecting through the form. So , it’s very important.</p><p>The SQL command below is used in creating a Database.</p><pre>CREATE DATABASE <strong>CRUD</strong> ; </pre><p>After creating the Database the next thing to create is the TABLE which will be holding all our data.</p><blockquote>A table is like a compartment in our database consisting of column(s) and row (s) for storing our records.</blockquote><p>Our table will be consisting of 4 columns which are : Name , Email , Phone Number and Location.</p><p>This is the SQL command to create the Table and the column :</p><pre>DROP TABLE IF EXISTS `customerdb`;</pre><pre>CREATE TABLE `customerdb` (</pre><pre>  `ID` int(11) NOT NULL AUTO_INCREMENT,</pre><pre>  `Name` varchar(20) NOT NULL,</pre><pre>  `Email` varchar(20) NOT NULL,</pre><pre>  `Number` int(11) NOT NULL,</pre><pre>  `Location` varchar(60) NOT NULL,</pre><pre>  PRIMARY KEY (`ID`)</pre><pre>) ENGINE=InnoDB DEFAULT CHARSET=latin1;</pre><p>The name of the table is <em>customerdb</em> , it is important to name your table a memorable and short name because you will be using it often when trying to operate with them.</p><p>The structure of the table should look like this after executing the SQL command :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*CgIlfQC11lYIN67LUPxPqw.png" /></figure><p>Now that we’ve created the Database and Table .</p><p>The next thing now is how to perform operations on our database.</p><p>This brings PHP to the play.</p><p>Now head over to your localhost , in the root create a folder for storing your code.</p><p>I will be naming the folder CRUD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*LRN3G4yjJf4iuEarRHI0nQ.png" /></figure><p>The next thing now is to connect is to our database using php.</p><p>Create a new file and name it <strong>config.php.</strong></p><p>Here is the code to connect to the database.</p><pre>&lt;?php</pre><pre>//Setting the credentials to connect to the database</pre><pre>$host = ‘Localhost’ ;</pre><pre>/*</pre><pre>$dbName is used to store the name of our DATABASE. </pre><pre>If the name of your database is different from &#39;crud&#39; change it </pre><pre>*/</pre><pre>$dbName = ‘crud’ ;</pre><pre>/*</pre><pre>The username of your DATABASE management system can be different. </pre><pre>You have to change it as well if it&#39;s different from &#39;root&#39;</pre><pre>*/ </pre><pre>$dbUser = ‘root’ ;</pre><pre>/*</pre><pre>If you password your Database system , try to include the password here. If you don&#39;t leave it blank. </pre><pre>*/ </pre><pre>$dbPass = ‘’ ;</pre><pre>$conn = mysqli_connect ($host , $dbUser , ‘’ , $dbName) ;</pre><pre>?&gt;</pre><p>There are several ways to connect to the database in PHP but this is the most straight forward for the beginner.</p><p>So , if you come across another way to connect to the database in PHP don’t be surprised.</p><p>Now let’s create the HTML form for collecting the customer data.</p><p>The form will contain the following field : Name , Email , Phone Number and Location.</p><p>Create an Index.php file in your folder to save the code.</p><p>Here is the Html code.</p><pre>&lt;!Doctype Html&gt; </pre><pre>&lt;html&gt;</pre><pre>&lt;head&gt;</pre><pre>&lt;title&gt; Customer records &lt;/title&gt;</pre><pre>&lt;/head&gt;</pre><pre>&lt;body&gt;</pre><pre>&lt;form name=&quot;my_form&quot; method=&quot;POST&quot; action =&quot;&lt;?php $_SERVER [&#39;PHP_SELF&#39;] ; ?&gt;&quot; &gt;</pre><pre>&lt;h1&gt; Input your customer record &lt;/h1&gt;</pre><pre>&lt;p&gt; &lt;Input type=”text” name=”Name” placeholder=”Customer Name” &gt; &lt;/p&gt;</pre><pre>&lt;p&gt; &lt;Input type=”Email” name=”Email” placeholder=”Email” &gt; &lt;/p&gt;</pre><pre>&lt;p&gt; &lt;Input type=”text” name=”Number” placeholder=”Phone Number” &gt; &lt;/p&gt;</pre><pre>&lt;p&gt; &lt;Input type=”text” name=”Location” placeholder = “Location” &gt; &lt;/p&gt;</pre><pre>&lt;Input type=”Submit” name=”submit” value=”Submit” &gt;</pre><pre>&lt;/form&gt; </pre><pre>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>The next thing now is inserting the data using PHP.</p><p>At the top of the HTML form add the following code.</p><pre>&lt;?php</pre><pre>//Including the configuration file. </pre><pre>require_once (‘config.php’) ;</pre><pre>//Checking If the user has submitted the form</pre><pre>if (isset ($_POST [‘submit’] )) {</pre><pre>//checking If the user has completely fill all the form field</pre><pre>if ( isset ($_POST [‘Name’] , $_POST [‘Email’] ,$_POST [‘Number’] ,$_POST [‘Location’] ) ) {</pre><pre>/*</pre><pre>mysqli_real_escape_string is for security purpose. It is used for escaping special characters inserted by the user which can sometimes be harmful to our database </pre><pre>*/ </pre><pre>$Name = mysqli_real_escape_string ($conn , $_POST [‘Name’]) ;</pre><pre>$Email = mysqli_real_escape_string ($conn , $_POST [‘Email’]) ; <br> <br>$Number = mysqli_real_escape_string ($conn , $_POST [‘Number’]) ;</pre><pre>$Location = mysqli_real_escape_string ($conn , $_POST [‘Location’]) ;</pre><pre>//Inserting the submitted data into the database. </pre><pre>$sql = “INSERT INTO customerdb (Name , Email , Number , Location) VALUES (‘$Name’ , ‘$Email’ , ‘$Number’ , ‘$Location’)” ;</pre><pre>//checking if the Query is successful. </pre><pre>if (mysqli_query ($conn , $sql) ) {<br> <br>$msg = “Successfully Created” ; <br> <br>}</pre><pre>else {</pre><pre>$msg = “oops! There is an error when creating your record. Retry again” ; <br> <br>} <br>}</pre><pre>}</pre><pre>?&gt; </pre><p>The code above showcase how you can use PHP and Mysql to insert data into a database.</p><p>This is a simple illustration , it can be taken further but for better understanding I have to stop there.</p><p>If you run the code in your browser it should be able to insert all the records you input into your form field into your database.</p><p>After that , you can check your table to see whether it has been inserted.</p><p>This is mine after testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*MCZZfr899i_BxQvJBgksyA.png" /></figure><p>You can try this for anything else and it will surely work.</p><p>In case you want to run this code on your own localhost and see how it works , you can download it on <a href="https://github.com/Adetona/Crud-tutorial">github.</a></p><p>You are free to extend its function as well</p><p>This brings us to the end of the PART 2.</p><p>I will be showcasing how to READ , UPDATE &amp; DELETE data from your database using PHP in the next part (probably , the last part of this tutorial).</p><p>Please recommend and share this post.</p><p>You can alert me of any error in this tutorial by sending a tweet to <a href="http://twitter.com/adetona77">@adetona77.</a></p><p>See you later.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30d58878fcf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding CRUD : using Facebook as the case study. (PART 1)]]></title>
            <link>https://medium.com/@Adetona77/understanding-crud-using-facebook-as-the-study-case-part-1-c4183cdf617a?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4183cdf617a</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[code-newbie]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Sun, 25 Dec 2016 02:36:47 GMT</pubDate>
            <atom:updated>2017-06-23T11:37:04.544Z</atom:updated>
            <content:encoded><![CDATA[<p>After learning the basics of your chosen back-end programming language as a newbie , the next most important thing you should try to do is to perform some CRUD operations.</p><p>This gives you a view on how you can use the language in the real world.</p><p>In fact , it will deepen your understanding about how some applications you use everyday work.</p><p>By the way , what is CRUD.</p><p>First of all , the full meaning of CRUD is (<strong>CREATE , READ , UPDATE AND DELETE </strong>). CRUD is a very interesting concept because once you understand how it works you will realized that you perform this operations on all applications you use everyday.</p><p>I will explain CRUD with Facebook as an example and how they use CRUD operation for some of the things you do everyday on their platform.</p><p><strong>CREATE.</strong></p><p>In this scenario , keywords like <em>input </em>and <em>insert</em> are synonymous to<strong> CREATE</strong>. To create means the process of inputting/inserting data into a system for storage (A language like SQL can be used to store data).</p><p>For example , during Facebook registration process you will have to give them a lot of your personal data like name , email and age before you can have access to their service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*hAJ51eranV545bYtTlURnw.png" /><figcaption>the process of inputting your name , mobile number , password etc. is known as CREATE.</figcaption></figure><p>The ability of the facebook system to accept your inserted data and store them is known as CREATE.</p><p>This process is made possible by using a back-end programming language (e.g. PHP) to send a request to a database language (e.g. SQL) for storage of your data. I will show you how to make this process work using PHP and mysql in the next part of this tutorial.</p><p><em>Add on : The process of tweeting a tweet and creating a facebook post are also part part of C in CRUD because it involves inputting/inserting data into a system for storage as well.</em></p><p><strong><em>READ.</em></strong></p><p>Facebook will be a useless product if it happens that after creating a post we can’t have access to see (or READ) what we posted on it.</p><p>So after CREATING your post , the process that allows you to see your post is known as READ. That is , the ability of reading the saved data from a system.</p><p><em>You create it. Why not read it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*H-87i9hJPZ97wTiLmxmHqw.png" /><figcaption>Was able to READ this post by a friend by the ability of R in CRUD. so inspirational.</figcaption></figure><p>READ operation can also be get done by using PHP and Mysql for retrieving stored data and present it into a readable form in the front end.</p><p><strong>UPDATE.</strong></p><blockquote>With U you can re-write your past.</blockquote><p>U means UPDATE , which means editing your data.</p><p>When you made a typo error in a facebook post all you have to do is to navigate to the edit button to make the neccessary changes in your post. What makes this process possible is the ability of a back-end language and database language to work together to retrieve data from where it is being stored and edit them.</p><p>e.g. A scenario where you wants to change your Facebook name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*FnLwfOFgBXmSBhOwNypnEQ.png" /><figcaption><strong>Can you see the EDIT ?</strong></figcaption></figure><p><strong>DELETE.</strong></p><p>Delete means cancelling or destroying something.</p><p>Facebook gives you the ability to delete any info you put into their system even you can delete your facebook account if you like. By deleting your data , that means you won’t be able to READ them again and have to CREATE another one if you feel like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*Tg3GuLs8IEngG8UUmMxW0Q.png" /></figure><p>Meanwhile , that’s the end of the breaking down of CRUD (PART 1).</p><p>Note : Crud is a very important concept in programming because there is no how you will create a content based application without applying CRUD operation. Just keep following me as I keep updating this tutorial on how to use it practically using PHP and Mysql. Don’t forget to read it page on <a href="https://en.wikipedia.org/wiki/Create,_read,_update_and_delete">wikipedia</a> for a deep understanding of the concept.</p><p>UPDATE : The PART 2 is <a href="https://medium.com/@Adetona77/understanding-crud-building-a-simple-application-for-storing-customer-records-using-php-30d58878fcf4">here</a>. Check out the code on <a href="https://github.com/Adetona/Crud-tutorial">github</a> as well.</p><p>Stay in touch on twitter : <a href="http://twitter.com/adetona77">@adetona77</a></p><p>See you later. Thanks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4183cdf617a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“For the things we have to learn before we can do them, we learn by doing them.” ― Aristotle]]></title>
            <link>https://medium.com/@Adetona77/for-the-things-we-have-to-learn-before-we-can-do-them-we-learn-by-doing-them-aristotle-8fe05234d8f4?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fe05234d8f4</guid>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Sun, 02 Oct 2016 01:08:13 GMT</pubDate>
            <atom:updated>2016-10-02T01:08:13.265Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“For the things we have to learn before we can do them, we learn by doing them.” ― </em><strong><em>Aristotle</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fe05234d8f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to save people sacked by robots.]]></title>
            <link>https://medium.com/@Adetona77/how-to-save-people-sacked-by-robots-fb7fe16fceed?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb7fe16fceed</guid>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Sun, 21 Aug 2016 12:19:10 GMT</pubDate>
            <atom:updated>2016-08-21T12:19:10.157Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*YAhzqd_-n_cIsk3v." /></figure><p>A driverless car will replace several drivers , a drone will make the job of a delivery man sluggish , a well trained robot-waiter might become more proficient than its human counterpart and more industries will be automated.</p><p>Now the question is : When every company is automating and retrenching at the same time what will be the fate of the unemployed due to the rise of these new civilization ?</p><p>I foresee a greater number of people being replaced by robots than when machines are replacing manual labourers in the 19 -20th century so the effect will be much bigger .</p><p>Imagine thousands to millions of workers being retrenched in the course of 5 years due to automation.</p><p>So what exactly do governments need to do that can act as palliative to the high unemployment rate so that the world won’t be vulnerable to insecurity due to the joblessness of many people.</p><p>There is one solution : <em>Robot tax</em>. yes , another tax.</p><h4>How would it work ?</h4><p>You tax every company automating on a large scale especially the ones using robots to do the most of their labour.</p><p>The tax will be used to<em> found and fund</em> several learning centers for acquiring new skills : skills like programming and some other valuable skills.</p><p>Some of these centers will only be enrolling those who are in need of new skills to survive and the un-skilled people that are being retrenched.</p><p>Not only would they be trained a new skill but will also be paid a token to survive until they finished their training.</p><p>I’m sure a palliative of this kind will be needed in developed countries that are undergoing a high level of automation at all level to cushion the effects of high unemployment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb7fe16fceed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello Medium.]]></title>
            <link>https://medium.com/@Adetona77/hello-medium-63f469fa3c4a?source=rss-7152f1aa2c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/63f469fa3c4a</guid>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[writing]]></category>
            <dc:creator><![CDATA[Abiodun Adetona]]></dc:creator>
            <pubDate>Mon, 30 May 2016 14:02:27 GMT</pubDate>
            <atom:updated>2016-05-30T14:02:27.723Z</atom:updated>
            <content:encoded><![CDATA[<p>Here’s my first writing on medium.</p><p>I’m already in love with everything here from the tools to the people using it.</p><p>Looking forward to be an active contributor and meeting lot of great people as well.</p><p>Thanks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63f469fa3c4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>