<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vinod Devasia</title>
    <description>The latest articles on DEV Community by Vinod Devasia (@vinodsys).</description>
    <link>https://dev.to/vinodsys</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F761632%2F4ed72627-3fbd-4dcd-8fcc-ceb1bf59b90e.jpg</url>
      <title>DEV Community: Vinod Devasia</title>
      <link>https://dev.to/vinodsys</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vinodsys"/>
    <language>en</language>
    <item>
      <title>Changing MySQL Default Port number</title>
      <dc:creator>Vinod Devasia</dc:creator>
      <pubDate>Fri, 18 Feb 2022 12:42:05 +0000</pubDate>
      <link>https://dev.to/vinodsys/changing-mysql-default-port-number-2dmj</link>
      <guid>https://dev.to/vinodsys/changing-mysql-default-port-number-2dmj</guid>
      <description>&lt;p&gt;Sometimes, when you install a new application on your server, they may compete/clash with port numbers already been used by other applications.  This may cause your server to slow down, some applications to crash or even servers to crash occasionally.  &lt;/p&gt;

&lt;p&gt;One such instance is MySQL crashing periodically after I installed a certain application.  Unfortunately, this application uses port 3306, and it has no method to specify a different port.  MySQL default port is 3306.  And it has good flexibility to change its port.  &lt;/p&gt;

&lt;p&gt;So let us see how.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 Edit the MySQL my.ini
&lt;/h2&gt;

&lt;p&gt;Go to [path-to-xampp-folder]/mysql/bin/ and open the file my.ini.  Or from Xampp, click on Config at the MySQL Module.&lt;/p&gt;

&lt;p&gt;Locate the line(s) containing '3306' no. and change it to '3390' or something else and save. Note to change both the server and client parts as shown in the figure below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--huf1Ihsm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o0t42egil4jw3mtzg8yp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--huf1Ihsm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o0t42egil4jw3mtzg8yp.png" alt="Lets change our port to 3390" width="880" height="907"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please make sure the new port number is not used by any other service.  You can use 'Netstat' to check all used ports on your system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MGWEyexV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p1swve57n0r23qky8y8e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MGWEyexV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p1swve57n0r23qky8y8e.png" alt="NetStat displaying the port used by diff apps" width="880" height="561"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 Edit the phpMyAdmin file
&lt;/h2&gt;

&lt;p&gt;We need to change the way phpMyAdmin connects to MySQL so that it knows that it has to use the new port number instead of the default one.  Failing to do so, will cause the following error whenever you try to connect to MySQL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0VUgISTX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofc6w9jfniwcmlh5b960.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0VUgISTX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofc6w9jfniwcmlh5b960.png" alt="phpMyAdmin failed to connect error" width="880" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From xampp control panel, click on the config for the apache server, and select the phpMyAdmin.ini and make the following changes as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ua3yijZh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wkiroobd9t5azs8gfri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ua3yijZh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wkiroobd9t5azs8gfri.png" alt="phpMyAdmin" width="880" height="809"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 Edit all website connections to use the new port
&lt;/h2&gt;

&lt;p&gt;Edit all configuration files in your webserver that connect to this MySQL instance with the new port number.&lt;/p&gt;

&lt;p&gt;Failing to do this will cause the web apps to fail.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--14lmsJOA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xhkv78fz84hz5dscac93.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--14lmsJOA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xhkv78fz84hz5dscac93.png" alt="MySQL Connection error" width="880" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Based on how your app connects to the MySQL server, either in the config file or a function, ensure that it knows that we are not connecting via the default port anymore.&lt;/p&gt;

&lt;p&gt;In my case, my App had a function connecting to the MySQL&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X-qM63Eg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gj22kjhfogckn8tq99zm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X-qM63Eg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gj22kjhfogckn8tq99zm.png" alt="add the port number" width="880" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And everything is back working!!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m4JHSZWL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1f55umtjbxwb1yp963y0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m4JHSZWL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1f55umtjbxwb1yp963y0.png" alt="App now connected to the new port" width="880" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
If you ever have to change the port of your MySQL server, ensure that you configure it both on servers, client connections, phpMyAdmin, and the connecting app(s). &lt;/p&gt;

</description>
      <category>mysql</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>xampp</category>
    </item>
    <item>
      <title>FREE Website TOOLS for Website Performance Tracking</title>
      <dc:creator>Vinod Devasia</dc:creator>
      <pubDate>Fri, 07 Jan 2022 01:51:41 +0000</pubDate>
      <link>https://dev.to/vinodsys/free-website-tools-for-website-performance-tracking-2jjb</link>
      <guid>https://dev.to/vinodsys/free-website-tools-for-website-performance-tracking-2jjb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;While developing a new web site, it is very necessary to ensure that the website is SEO friendly, and we may need to track the quality of our pages, what keywords our competitors are using, what is the website rank, what improvement we can do to make the site stand out above the competitions.&lt;/p&gt;

&lt;p&gt;I have compiled quite a few sites that I have been using, and sharing them here. Best of all, all of these are FREE service.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Website Components
&lt;/h3&gt;

&lt;p&gt;Find out what websites are Built With the following links. These websites provides information about the website technology profile such as what analytics and tracking is being used, widgets used, ecommerce platform, JavaScript used, ssl certificate details;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://builtwith.com/?https://www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Built With Link&lt;/a&gt;&lt;br&gt;
&lt;a href="https://w3techs.com/sites/info/buybrandeddomain.com" rel="noopener noreferrer"&gt;W3Techs Component review&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwoe24n9adgkzlgmkq0xo.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwoe24n9adgkzlgmkq0xo.JPG" alt="What a website is built with details"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Nu  Html Checker
&lt;/h3&gt;

&lt;p&gt;The Nu Html Checker (v.Nu) is an ongoing experiment in better HTML checking, and its behavior remains subject to change. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://validator.w3.org/nu/?doc=https://www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Nu Html Checker&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Site information
&lt;/h3&gt;

&lt;p&gt;Some general site information, this may overlap some of the links provided already.  Some may be in German or Russian, and you may need to use google translate to understand the information provided;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.infositeshow.com/sites/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;info site show&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.talkreviews.com/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;talk reviews&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.statscrop.com/www/buybrandeddomain.com" rel="noopener noreferrer"&gt;stats crop&lt;/a&gt;&lt;br&gt;
&lt;a href="https://a.pr-cy.ru/www.buybrandeddomain.com/" rel="noopener noreferrer"&gt;pr.cy&lt;/a&gt;&lt;br&gt;
&lt;a href="https://be1.ru/stat/buybrandeddomain.com" rel="noopener noreferrer"&gt;bel.ru&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. IPS / DNS Lookup
&lt;/h3&gt;

&lt;p&gt;These includes details such as IP number, DNS Reverse lookup information, WHOIS Records, WOT information, any Virus threats, Any Realtime block details, Geo location etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.robtex.com/dns-lookup/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;robtex whois&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.ip-adress.com/website/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;ip-address info&lt;/a&gt;&lt;br&gt;
&lt;a href="http://whois.phurix.co.uk/buybrandeddomain.com" rel="noopener noreferrer"&gt;phurix whois&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.whois.com/whois/buybrandeddomain.com" rel="noopener noreferrer"&gt;whois&lt;/a&gt;&lt;br&gt;
&lt;a href="https://who.is/whois/buybrandeddomain.com" rel="noopener noreferrer"&gt;who.is&lt;/a&gt;&lt;br&gt;
&lt;a href="https://whois.de/buybrandeddomain.com" rel="noopener noreferrer"&gt;whois.de&lt;/a&gt;&lt;br&gt;
&lt;a href="https://whoislookupdb.com/whois-www.buybrandeddomain.com" rel="noopener noreferrer"&gt;whois lookup&lt;/a&gt;&lt;br&gt;
&lt;a href="http://website.informer.com/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;informer.com&lt;/a&gt;&lt;br&gt;
&lt;a href="http://www.viewwhois.com/www.buybrandeddomain.com/" rel="noopener noreferrer"&gt;View who is&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.dnswhois.info/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;DNS Who is&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.rbls.org/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Is your website in any DNS Block list&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Website Worth and Traffic Statistics/Ranking information
&lt;/h3&gt;

&lt;p&gt;These website provides details such as Website worth and traffic estimates, backlinks details, search engine and internet presence details.  There are a bunch of places one can find these for free, and I am including a few here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.statshow.com/www/buybrandeddomain.com" rel="noopener noreferrer"&gt;Stat Show&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.worthofweb.com/website-value/www.buybrandeddomain.com/" rel="noopener noreferrer"&gt;Worth of Web&lt;/a&gt;&lt;br&gt;
&lt;a href="http://www.siteworthtraffic.com/report/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Site worth traffic&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hqindex.org/buybrandeddomain.com" rel="noopener noreferrer"&gt;HqIndex&lt;/a&gt;&lt;br&gt;
&lt;a href="https://valueanalyze.com/show.php?url=www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Value Analyze&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.siteprice.org/AnalyzeSite.aspx?url=buybrandeddomain.com" rel="noopener noreferrer"&gt;Site Price&lt;/a&gt;&lt;br&gt;
&lt;a href="http://sitevaluefox.com/website-value-calculator/show.php?url=www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Site Value fox&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.urlrate.com/process.php?q=www.buybrandeddomain.com&amp;amp;t=auto" rel="noopener noreferrer"&gt;url Rate&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.woorank.com/en/teaser-review/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Woo rank&lt;/a&gt;&lt;br&gt;
&lt;a href="http://ranking.websearch.com/siteinfo.aspx?url=www.buybrandeddomain.com" rel="noopener noreferrer"&gt;web search ranking&lt;/a&gt;&lt;br&gt;
&lt;a href="http://ranking.crawler.com/SiteInfo.aspx?url=www.buybrandeddomain.com/" rel="noopener noreferrer"&gt;crawler ranking&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.mywot.com/en/scorecard/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;my wot&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21zrewehswqutou6bqo6.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21zrewehswqutou6bqo6.JPG" alt="These site shows the sample site is worth $10-30 :) pretty sure that number will jump soon"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Keyword Analyze
&lt;/h3&gt;

&lt;p&gt;Through this keyword tool, you can perform advanced keyword research and keyword tracking to study what your competitors have been advertising in AdWords &amp;amp; Other PPC campaigns to improve your own PPC campaign. Finally with this keyword software, you can now get AdWords tips and a complete in-depth analysis, stats, budget, affiliates &amp;amp; ad copies of your competitors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.spyfu.com/overview/domain?query=www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Spy Fu&lt;/a&gt;&lt;br&gt;
&lt;a href="http://www.serpanalytics.com/#competitor/www.buybrandeddomain.com/summary//1" rel="noopener noreferrer"&gt;Serp Analytics&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Is Website Up and running ?
&lt;/h3&gt;

&lt;p&gt;These websites will check and report if your website is up and running&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.websitedown.info/buybrandeddomain.com" rel="noopener noreferrer"&gt;Website down ?&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  8. What is your websites reputation ranking?
&lt;/h3&gt;

&lt;p&gt;These websites will check and report if your website reputation score.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://scamanalyze.com/check/www.buybrandeddomain.com.html" rel="noopener noreferrer"&gt;scamanalyze&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  9. Free backlink for your website.
&lt;/h3&gt;

&lt;p&gt;Just attach your website name to these URLs and you have a few free backlink to your websites ;)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.deviantart.com/users/outgoing?www.buybrandeddomain.com" rel="noopener noreferrer"&gt;deviant art&lt;/a&gt;&lt;br&gt;
&lt;a href="https://proza.ru/go/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;proza.ru&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.ibm.com/links/?cc=us&amp;amp;lc=en&amp;amp;prompt=1&amp;amp;url=//www.buybrandeddomain.com" rel="noopener noreferrer"&gt;ibm.com&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  10. Time capsule
&lt;/h3&gt;

&lt;p&gt;Archive.today is a time capsule for web pages, It takes a 'snapshot' of a webpage that will always be online even if the original page disappears. It saves a text and a graphical copy of the page for better accuracy and provides a short and reliable link to an unalterable record of any web page&lt;/p&gt;

&lt;p&gt;&lt;a href="http://archive.is/www.buybrandeddomain.com/" rel="noopener noreferrer"&gt;archive.is&lt;/a&gt;&lt;br&gt;
&lt;a href="http://web.archive.org/web/*/www.buybrandeddomain.com/" rel="noopener noreferrer"&gt;archive.org&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  11. SEO Optimization Reports
&lt;/h3&gt;

&lt;p&gt;This is one of my favorite free SEO Optimization tools.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://w3seo.info/WSZScore/www.buybrandeddomain.com/" rel="noopener noreferrer"&gt;w3SEO&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.seoptimer.com/www.buybrandeddomain.com" rel="noopener noreferrer"&gt;SEO Optimizer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk8jq6v7ulyidhm613ayo.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk8jq6v7ulyidhm613ayo.JPG" alt="SEO Optimization report"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  12. Social Media Presence
&lt;/h3&gt;

&lt;p&gt;Add your website URL link to many social media sites from here;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.addtoany.com/share_save?linkname=&amp;amp;linkurl=www.buybrandeddomain.com" rel="noopener noreferrer"&gt;Add to Many&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;While developing a website, it is essential to keep track of the quality, and the SEO worth of the website and to do that we have a bunch of website tools that provides these information absolutely free to use&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>productivity</category>
      <category>testing</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Google Search Console - Text too small to read - ERROR</title>
      <dc:creator>Vinod Devasia</dc:creator>
      <pubDate>Sat, 01 Jan 2022 18:38:01 +0000</pubDate>
      <link>https://dev.to/vinodsys/google-search-console-text-too-small-to-read-error-bb0</link>
      <guid>https://dev.to/vinodsys/google-search-console-text-too-small-to-read-error-bb0</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Recently after submitting a website sitemap to google search console, I encounter two errors, of which I will cover the 1st type, which is Text too small to read.&lt;/p&gt;

&lt;p&gt;This is how the error is displayed in the google search console, regarding a particular page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1vBFIt2s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w87q6jgd3fjm3ewmuws5.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1vBFIt2s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w87q6jgd3fjm3ewmuws5.JPG" alt="The number of pages affected" width="880" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So in this article I will explain how to fix this problem.  &lt;/p&gt;

&lt;h2&gt;
  
  
  What is the "Text too small to read" Error?
&lt;/h2&gt;

&lt;p&gt;Since google wants to offer a good user experience, and expects majority of the users to view your website using a mobile or similar device, it want to ensure that the users will have to "pinch to zoom" on your pages to read the contents, if the font sizes are too small.&lt;/p&gt;

&lt;p&gt;So this error indicates that google Smartphone crawler has identified that your page has a mobile usability error, and somewhere on your page, some text has the font size too small, and will cause the "pinch to zoom" behavior.&lt;/p&gt;

&lt;p&gt;Lets see how we can fix this.&lt;/p&gt;

&lt;h3&gt;
  
  
  STEP 1 Find out which pages are causing this problem
&lt;/h3&gt;

&lt;p&gt;Below the error report, google search console will also display the pages that caused the problem.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uZ_rYC2M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmu3r7xg2jqqp5m8hl5e.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uZ_rYC2M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmu3r7xg2jqqp5m8hl5e.JPG" alt="examples of the problematic urls" width="880" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  STEP 2 Ensure that you have the Meta Tag viewport in the page heading.
&lt;/h3&gt;

&lt;p&gt;The viewport is the users visible area of the web page, and it will vary with the device used to view your website.  A computer screen will have the largest view area, while a mobile the lowest view area.  To instruct the browser how to control the page dimension and scaling we use the meta tag viewport as shown below;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1"&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;the width=device-width tells to set the width of the viewport to the device width, and initial-scale=1 tells it to use zoom level 1 as default zoom.&lt;/p&gt;

&lt;p&gt;right click and select view page source, and inspect the head section to see, if the page contains the meta tag viewport.  If that is missing add the above line of code to your webpage head section.&lt;/p&gt;

&lt;h3&gt;
  
  
  STEP 3 Check the font size in the page
&lt;/h3&gt;

&lt;p&gt;In general, the rule of thumb is that font size needs to be 16 pixels for mobile websites. Anything smaller than that could compromise readability for visually impaired readers. Anything too much larger could also make reading more difficult. &lt;/p&gt;

&lt;p&gt;Clicking Ctrl + Shift + J to bring the console screen, inspect your text font size.  if you find that the text size is smaller than 16 font size, fix it to at least 16, or keep increasing it by one px till google stops complaining.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ras3OqhX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqbot4oo01xoqqlk1tj2.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ras3OqhX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqbot4oo01xoqqlk1tj2.JPG" alt="In my case the font size was 15px" width="831" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you have completed all the fixes stated above, you can now click on the Validate Fix button to signal google that the fix is in place and let it retest your page again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M7X5Dy6j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xx7m4lf14wst218gjtez.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M7X5Dy6j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xx7m4lf14wst218gjtez.JPG" alt="Validate fix button" width="564" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google will start the validation process to see if the “text too small to read” issue has been fixed on your site, and if it finds no errors are detected, the validation will be declared as passed.&lt;/p&gt;

&lt;p&gt;it will send you an email saying the process has started as well..&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7zwwT8-M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9zomu55d6m8bkym5344.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7zwwT8-M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9zomu55d6m8bkym5344.JPG" alt="email" width="880" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the result!!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0Lo4yCXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpn4ajhgt2wxzj8mfljk.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0Lo4yCXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpn4ajhgt2wxzj8mfljk.JPG" alt="fixed results from google" width="880" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are two links that will check your webpage for mobile friendliness so that you can fix any errors before submitting it to google search.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://search.google.com/test/mobile-friendly?hl=en"&gt;Google Mobile friendliness check page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.bing.com/webmaster/tools/mobile-friendliness"&gt;Bing Mobile friendliness check page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ao5PhSX6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fsv1yl71blp40jdhbyhm.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ao5PhSX6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fsv1yl71blp40jdhbyhm.JPG" alt="A sample page passed as mobile friendly" width="880" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;It is very essential that all webpages we design are mobile friendly and before submitting to google search it is advisable to do a quick check for mobile friendliness and fix all the issues.&lt;/p&gt;

</description>
      <category>php</category>
      <category>html</category>
      <category>tutorial</category>
      <category>css</category>
    </item>
    <item>
      <title>CSS Shopping cart Icon with number of items.</title>
      <dc:creator>Vinod Devasia</dc:creator>
      <pubDate>Tue, 21 Dec 2021 13:05:49 +0000</pubDate>
      <link>https://dev.to/vinodsys/css-shopping-cart-icon-with-number-of-items-52a0</link>
      <guid>https://dev.to/vinodsys/css-shopping-cart-icon-with-number-of-items-52a0</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Every eCommerce website, need to display the number of items the customer has put into the shopping cart. Let me show you how easy it is to display this using a bit of html and CSS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft88g6wbh14mjjcfrvb8u.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft88g6wbh14mjjcfrvb8u.JPG" alt="shopping cart icon"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  STEP 1 Include the font awesome stylesheet CDN
&lt;/h3&gt;

&lt;p&gt;We need this to get the awesome font image for the shopping cart.  Include this in the &lt;code&gt;&amp;lt;HEAD&amp;gt;&lt;/code&gt; section of your html page.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;link href="https://use.fontawesome.com/releases/v5.0.1/css/all.css" rel="stylesheet"&amp;gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  STEP 2 lets write the style for the badge using CSS
&lt;/h3&gt;

&lt;p&gt;A badge is the round circle with the number of items the customer have added to the shopping cart so far.  &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    .badge:after{
        content:attr(value);
        font-size:12px;
        color: #fff;
        background: red;
        border-radius:50%;
        padding: 0 5px;
        position:relative;
        left:-8px;
        top:-10px;
        opacity:0.9;
    }


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Explanation :&lt;/p&gt;

&lt;p&gt;We will display the value passed to the badge, the value here is the number of items in the cart.   we are using white font color, with a background of red.  We are using :after to indicate we want the badge to be displayed after displaying the cart icon.&lt;/p&gt;

&lt;h3&gt;
  
  
  STEP 3 Writing the html portion
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;i class="fa badge fa-lg" value=5&amp;gt;&amp;amp;#xf290;&amp;lt;/i&amp;gt;
&amp;lt;i class="fa badge fa-lg" value=8&amp;gt;&amp;amp;#xf07a;&amp;lt;/i&amp;gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Explanation :&lt;/p&gt;

&lt;p&gt;We using html list item i to display the cart.  we are displaying the cart icon with a font size of 24px.  &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;amp;#xf290;&lt;/code&gt; is for the shopping bag&lt;br&gt;
&lt;code&gt;&amp;amp;#xf07a;&lt;/code&gt; is for the shopping cart&lt;/p&gt;

&lt;p&gt;&lt;a href="https://fontawesome.com/v5/cheatsheet" rel="noopener noreferrer"&gt;You can find more free font awesome codes by clicking this link&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have included the entire code here&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;&amp;lt;html&amp;gt;&lt;br&gt;
&amp;lt;head&amp;gt;&lt;br&gt;
    &amp;lt;link href="&lt;a href="https://use.fontawesome.com/releases/v5.0.1/css/all.css" rel="noopener noreferrer"&gt;https://use.fontawesome.com/releases/v5.0.1/css/all.css&lt;/a&gt;" rel="stylesheet"&amp;gt;&lt;br&gt;
&amp;lt;/head&amp;gt;&lt;br&gt;
&amp;lt;body&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;style&amp;gt;&lt;br&gt;
    .badge:after{&lt;br&gt;
        content:attr(value);&lt;br&gt;
        font-size:12px;&lt;br&gt;
        color: #fff;&lt;br&gt;
        background: red;&lt;br&gt;
        border-radius:50%;&lt;br&gt;
        padding: 0 5px;&lt;br&gt;
        position:relative;&lt;br&gt;
        left:-8px;&lt;br&gt;
        top:-10px;&lt;br&gt;
        opacity:0.9;&lt;br&gt;
    }&lt;/p&gt;

&lt;p&gt;&amp;lt;/style&amp;gt;&lt;br&gt;
&amp;lt;body&amp;gt;&lt;br&gt;
&amp;lt;i class="fa badge fa-lg" value=5&amp;gt;&amp;amp;#xf290;&amp;lt;/i&amp;gt;&lt;br&gt;
&amp;lt;i class="fa badge fa-lg" value=8&amp;gt;&amp;amp;#xf07a;&amp;lt;/i&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/body&amp;gt;&lt;br&gt;
&amp;lt;/html&amp;gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Conclusion&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;With simple HTML and CSS, we can build an awesome display for the shopping cart icon with items in it.  Note, you will have to use either PHP or .JS in real scenario to provide the number of items as they cannot be static as shown in the above example.  &lt;/p&gt;

</description>
      <category>css</category>
      <category>shoppingcart</category>
      <category>header</category>
      <category>icon</category>
    </item>
    <item>
      <title>Creating a table from an existing MySQL table using SQL Query</title>
      <dc:creator>Vinod Devasia</dc:creator>
      <pubDate>Sat, 11 Dec 2021 12:30:39 +0000</pubDate>
      <link>https://dev.to/vinodsys/creating-a-table-from-an-existing-mysql-table-using-sql-query-3c23</link>
      <guid>https://dev.to/vinodsys/creating-a-table-from-an-existing-mysql-table-using-sql-query-3c23</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;Sometimes when you start with a new project, you may want to create a new table which may be very similar to some table in the same database, or other.  It may be combination of several tables, or a self-join, along with the data as well.  Instead of creating the table, and then filling the data, or using export and import features of MySQL, we can use SQL Queries to do the job for us.&lt;br&gt;
In this article I will be talking about this with a couple of examples&lt;/p&gt;

&lt;p&gt;The syntax of creating a table with SQL Query is as follows&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE new_tbl &lt;br&gt;
              AS SELECT * FROM orig_tbl;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 1  Creating a subset of a larger table
&lt;/h2&gt;

&lt;p&gt;Lets assume we have a very big table called Cities which has about 147110 rows.  It contains almost all the cities information of the world.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vs1QKd0H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nmpzbp9h1duf095s36aq.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vs1QKd0H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nmpzbp9h1duf095s36aq.JPG" alt="The original Cities table with over 147110 rows" width="880" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For some new application, we want a table called citys with only county code 233 which is for the United States of America.   The following SQL statement will do the trick&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE citys&lt;br&gt;
    AS SELECT * FROM cities&lt;br&gt;
      WHERE country_id = 233;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
If we peek into the newly created citys table, we will find the cities of USA only in this newly created table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b9sVdOTc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5c1o3ofss3j4aev4lpqa.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b9sVdOTc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5c1o3ofss3j4aev4lpqa.JPG" alt="The newly created citys table" width="880" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 2 – Creating table with data from several tables
&lt;/h2&gt;

&lt;p&gt;We will recreate the citys table again but this time we will add more information using two more tables states and countries to fill in the details rather than just the codes.  We will restrict our table columns to id, name, state_name, country_name&lt;br&gt;
Here we are joining the three tables’ cities, states and country, and creating a new table called citys, with new names for the columns as well.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE citys&lt;br&gt;
AS&lt;br&gt;
SELECT c.id, c.name as city_name, s.name as state_name, ct.name as country_name FROM cities c&lt;br&gt;
   LEFT JOIN states s ON c.state_id = s.id &lt;br&gt;
   LEFT JOIN countries ct ON c.country_id = ct.id&lt;br&gt;
   WHERE c.country_id = 233;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let’s see how our new table looks like now&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xGpNSjoa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43i4trqkgeib8j7dbpld.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xGpNSjoa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43i4trqkgeib8j7dbpld.JPG" alt="More detailed citys table" width="683" height="744"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note : When creating a table with CREATE TABLE ... SELECT, make sure to alias any function calls or expressions in the query. If you do not, the CREATE statement might fail or result in undesirable column names.   In the above example since we used three tables and there were many columns (especially the id and names) common in these tables, we made sure we aliased the column names to specify very clearly which columns we are referring to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 3 – Creating a table which exists in another database
&lt;/h2&gt;

&lt;p&gt;If we want to create a new table in a new database, but the tables are existing in another database in the same server, then all we need to do is to include the database name as well in front of the table names.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE new_tbl &lt;br&gt;
              AS SELECT * FROM database.orig_tbl;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To create our citys table in another database (assume the three tables are in a database with name newdb)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE Citys&lt;br&gt;
AS&lt;br&gt;
SELECT c.id, c.name as city_name, s.iso2 as state_code, s.name as state_name, &lt;br&gt;
             ct.iso2 as country_code, ct.iso3 as country_iso3, ct.name as country_name,&lt;br&gt;
             ct.phonecode as phonecode, ct.currency as currency, ct.region as region,&lt;br&gt;
             ct.subregion as subregion&lt;br&gt;
   FROM newdb.cities c&lt;br&gt;
   LEFT JOIN newdb.states s ON c.state_id = s.id &lt;br&gt;
   LEFT JOIN newdb.countries ct ON c.country_id = ct.id&lt;br&gt;
   WHERE c.country_id = 233;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And we should find our newly created citys table in the current database&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q2qlrgmn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xejdi2lhlav5ab9gm96i.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q2qlrgmn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xejdi2lhlav5ab9gm96i.JPG" alt="newly created table with tables from another database" width="880" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  INDEXES
&lt;/h3&gt;

&lt;p&gt;The city table we just created has about 19,818 rows.  If we inspect the structure of the table, you will notice that there is no index on the newly created table!  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gknNFWtQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/raj6vyafvcxbg0j2qw6x.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gknNFWtQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/raj6vyafvcxbg0j2qw6x.JPG" alt="The Index is missing in the newly created citys table" width="880" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CREATE TABLE ... SELECT does not automatically create any indexes for you. This is done intentionally to make the statement as flexible as possible. If you want to have indexes in the created table, you should specify these before the SELECT statement:&lt;/p&gt;

&lt;p&gt;So let recreate the table, but this time we will specify to create the indexes as well.  Let us see how&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE Citys (PRIMARY KEY (id))&lt;br&gt;
AS&lt;br&gt;
SELECT c.id, c.name as city_name, s.iso2 as state_code, s.name as state_name, &lt;br&gt;
             ct.iso2 as country_code, ct.iso3 as country_iso3, ct.name as country_name,&lt;br&gt;
             ct.phonecode as phonecode, ct.currency as currency, ct.region as region,&lt;br&gt;
             ct.subregion as subregion&lt;br&gt;
   FROM newdb.cities c&lt;br&gt;
   LEFT JOIN newdb.states s ON c.state_id = s.id &lt;br&gt;
   LEFT JOIN newdb.countries ct ON c.country_id = ct.id&lt;br&gt;
   WHERE c.country_id = 233;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you will find the new table with a PRIMARY KEY index as well&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VHOAF96A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kikppg220aqzbat3xjdy.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VHOAF96A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kikppg220aqzbat3xjdy.JPG" alt="Newly created table with PRIMARY KEY as well" width="824" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article on how to create a new table from existing ones, with the help of SQL queries.&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>table</category>
      <category>query</category>
      <category>existing</category>
    </item>
    <item>
      <title>Managing different PHP Versions while testing Laravel Modules.</title>
      <dc:creator>Vinod Devasia</dc:creator>
      <pubDate>Thu, 09 Dec 2021 12:35:47 +0000</pubDate>
      <link>https://dev.to/vinodsys/managing-different-php-versions-while-testing-laravel-modules-40o3</link>
      <guid>https://dev.to/vinodsys/managing-different-php-versions-while-testing-laravel-modules-40o3</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Though I like to work with the latest version of PHP, which is 8+, many times while testing some Open-source modules of Laravel framework, I encountered problems such as finding some of the module’s dependencies require a different PHP version.  &lt;/p&gt;

&lt;p&gt;Example while trying to install this module with PHP 7.4 installed on my laptop;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require postcode-nl/api-magento2-module&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;However, the installation failed this error:&lt;/p&gt;

&lt;p&gt;`Updating dependencies (including require-dev)&lt;br&gt;
Your requirements could not be resolved to an installable set of packages.&lt;/p&gt;

&lt;p&gt;Problem 1&lt;br&gt;
    - feedbackcompany/module-reviews 1.0.0 requires php ~7.1.3||~7.2.0||~7.3.0 -&amp;gt; your PHP version (7.4.18) does not satisfy that requirement.&lt;br&gt;
    - feedbackcompany/module-reviews 1.0.0 requires php ~7.1.3||~7.2.0||~7.3.0 -&amp;gt; your PHP version (7.4.18) does not satisfy that requirement.&lt;br&gt;
    - feedbackcompany/module-reviews 1.0.0 requires php ~7.1.3||~7.2.0||~7.3.0 -&amp;gt; your PHP version (7.4.18) does not satisfy that requirement.&lt;br&gt;
    - Installation request for feedbackcompany/module-reviews ^1.0 -&amp;gt; satisfiable by feedbackcompany/module-reviews[1.0.0].&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;If you ever faced a problem like this, there are two ways to handle this;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Force composer installation to ignore PHP version requirements
&lt;/h3&gt;

&lt;p&gt;A new feature in Composer v2 allows you to selectively ignore platform requirements.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer install --ignore-platform-req=php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Composer already had the --ignore-platform-reqs option, but it ignored all platform requirements, including PHP version, extensions (ext-*), and composer-plugin-api.  However now we can just use it to set specific requirements that Composer can ignore.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Temporarily change the PHP version to the version required
&lt;/h3&gt;

&lt;p&gt;Now this can be a hassle to uninstall the entire XAMPP installation and reinstalling especially since XAMPP don’t even allow installing on a folder if it exists already.  &lt;/p&gt;

&lt;p&gt;Now assuming you already have some XAMPP version running,  you can download multiple portable version of PHP that you wish to work from the link below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sourceforge.net/p/xampp/activity/?page=0&amp;amp;limit=100#619f851aaa0ec74743cc7a56"&gt;https://sourceforge.net/p/xampp/activity/?page=0&amp;amp;limit=100#619f851aaa0ec74743cc7a56&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Remember to click on show all activity, to see all the different versions available)&lt;/p&gt;

&lt;p&gt;Download the version of PHP’s you want, ensuring you are selecting the portable version, and not the executable version.  (Either .zip or .7z)&lt;/p&gt;

&lt;p&gt;Here are some versions I downloaded&lt;/p&gt;

&lt;p&gt;XAMPP released /XAMPP Windows/8.0.13/xampp-portable-windows-x64-8.0.13-0-VS16.zip&lt;br&gt;
XAMPP released /XAMPP Windows/7.4.26/xampp-portable-windows-x64-7.4.26-0-VC15.zip&lt;br&gt;
XAMPP released /XAMPP Windows/7.3.33/xampp-windows-x64-7.3.33-0-VC15.zip&lt;/p&gt;

&lt;p&gt;And so on.&lt;/p&gt;

&lt;p&gt;Unzip them one by one in their own folders and then delete everything inside them except the Apache and PHP folders.  I have arranged them as follows in my laptop&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Alf6NFSC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a1ta7hy91k3wk522ifvg.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Alf6NFSC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a1ta7hy91k3wk522ifvg.JPG" alt="Different version of PHP downloaded and unzipped" width="745" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As mentioned, each version only contains the Apache and PHP folders only. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9MwZp49E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ow0ykfww9uagqv2z0rfu.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9MwZp49E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ow0ykfww9uagqv2z0rfu.JPG" alt="We only need the Apache and PHP folders" width="422" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the current PHP version’s php.ini (c:\xampp\php\php.ini) to the correct versions PHP folder here, so that you don’t lose any configuration you had made and want it back when you put your original PHP version back.&lt;/p&gt;

&lt;p&gt;Next, you need to stop all services in the XAMPP control panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I1tyj2Jq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3i00j3pzec07o5fbkq3o.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I1tyj2Jq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3i00j3pzec07o5fbkq3o.JPG" alt="All services stopped" width="880" height="573"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next delete the Apache and PHP folder from the c:\xampp folder (or wherever your XAMPP installation files are).  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TL7HgwMq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lt1nv48xwalff7hpliwt.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TL7HgwMq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lt1nv48xwalff7hpliwt.JPG" alt="Delete the current PHP and Apache folders" width="880" height="741"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now copy the Apache and PHP file from the version you want here.  Restart the services from XAMPP, and that’s it.  You have got the PHP version you want installed.&lt;/p&gt;

&lt;p&gt;When you have done testing, you can revert back to the original version by doing the same steps as described above.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>versions</category>
      <category>modules</category>
    </item>
    <item>
      <title>How To insert Non-English Text into MySQL Tables</title>
      <dc:creator>Vinod Devasia</dc:creator>
      <pubDate>Sat, 04 Dec 2021 17:13:02 +0000</pubDate>
      <link>https://dev.to/vinodsys/how-to-insert-non-english-text-into-mysql-tables-54k</link>
      <guid>https://dev.to/vinodsys/how-to-insert-non-english-text-into-mysql-tables-54k</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When we work with web application that may be accessed globally, we may need to display messages in non-English characters and may need to store these non-English characters in our database tables.  In this article, I will explain how to store non-English characters in MySQL.&lt;/p&gt;

&lt;p&gt;Lets first see why it is necessary with an example.&lt;/p&gt;

&lt;p&gt;Let create a simple table, which has three columns.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Create table Langs&lt;br&gt;
(&lt;br&gt;
    LangId  char(2),&lt;br&gt;
        KeyName varchar(20),&lt;br&gt;
    KeyValue varchar(50)&lt;br&gt;
);&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Lets Insert a few values in English, Catalan, German, Hindi and Russian into this newly created table as follows;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Insert into Langs(LangId, KeyName, KeyValue) values('EN','userid_required','User ID required!');&lt;br&gt;
Insert into Langs(LangId, KeyName, KeyValue) values('CA','userid_required','Es requereix identificador d\'usuari!');&lt;br&gt;
Insert into Langs(LangId, KeyName, KeyValue) values('GE','userid_required','Benutzerkennung erforderlich!');&lt;br&gt;
Insert into Langs(LangId, KeyName, KeyValue) values('HD','userid_required','यूजर आईडी जरूरी!');&lt;br&gt;
Insert into Langs(LangId, KeyName, KeyValue) values('RS','userid_required','Требуется идентификатор пользователя!');&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Notice the \' in the  d\'usuari!.  We have used the backward slash in front of the apostrophe to include the special apostrophe character in our data.&lt;/p&gt;

&lt;p&gt;Let see how the data will show up in our Langs MySQL table. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yr3ZcVIS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2whw84ta7rz7o6ovchz9.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yr3ZcVIS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2whw84ta7rz7o6ovchz9.JPG" alt="Table with mumbled up text for non English characters" width="721" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see the non-English data got stored in ??? which is not what we want.&lt;/p&gt;

&lt;p&gt;We can configure MySQL to accept non-English characters in two ways&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring at the Table Level.
&lt;/h2&gt;

&lt;p&gt;While creating the table, we can specify that the tables charset is utf8mb4, which will allow us to store non-English characters in the table.  Note this effect the entire table column and not just a specific column.&lt;/p&gt;

&lt;p&gt;Lets drop that table and recreate it this time, and specifying that the tables charset set is utf8mb4&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
CREATE TABLE&lt;/code&gt;Langs&lt;code&gt;(&lt;br&gt;
&lt;/code&gt;LangId&lt;code&gt;char(2) NOT NULL ,&lt;br&gt;
&lt;/code&gt;KeyName&lt;code&gt;varchar(30) NOT NULL,&lt;br&gt;
&lt;/code&gt;KeyValue&lt;code&gt;varchar(100) NOT NULL&lt;br&gt;
) DEFAULT CHARSET=utf8mb4;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Lets try re-inserting the values in English, Catalan, German, Hindi and Russian as before;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Insert into Langs(LangId, KeyName, KeyValue) values('EN','userid_required','User ID required!');&lt;br&gt;
Insert into Langs(LangId, KeyName, KeyValue) values('CA','userid_required','Es requereix identificador d\'usuari!');&lt;br&gt;
Insert into Langs(LangId, KeyName, KeyValue) values('GE','userid_required','Benutzerkennung erforderlich!');&lt;br&gt;
Insert into Langs(LangId, KeyName, KeyValue) values('HD','userid_required','यूजर आईडी जरूरी!');&lt;br&gt;
Insert into Langs(LangId, KeyName, KeyValue) values('RS','userid_required','Требуется идентификатор пользователя!');&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---cCoJ2Ep--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzqrghda2pvk2bwwg8l9.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---cCoJ2Ep--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzqrghda2pvk2bwwg8l9.JPG" alt="Non English stored correctly in the table" width="660" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we got the non-English characters stored properly into the tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring at the Database Level.
&lt;/h2&gt;

&lt;p&gt;If we have many tables that need to store non-English characters, then we can configure the database while creating it as follows;&lt;/p&gt;

&lt;p&gt;You can do this at the database creation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE DATABASE mydb&lt;br&gt;
  DEFAULT CHARACTER SET utf8mb4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we don't have to specify the CHARSET=utf8mb4 for individual tables. &lt;/p&gt;

&lt;p&gt;We can also alter a existing database with the alter database command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ALTER DATABASE mydb&lt;br&gt;
         DEFAULT CHARSET utf8mb4;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;To store the non-English Characters or Multi language in MySQL database table, we can configure it in two ways.  Either at the table level, or the database itself.  Character set utf8mb4 helps us to store non-English characters into the MySQL tables.&lt;/p&gt;

&lt;p&gt;I hope you all found this article useful.  Please share your feedback in the comment section.&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>nonenglish</category>
      <category>utf8mb4</category>
      <category>characterset</category>
    </item>
    <item>
      <title>AUTO INCREMENT On A MySQL Secondary Column</title>
      <dc:creator>Vinod Devasia</dc:creator>
      <pubDate>Fri, 03 Dec 2021 20:54:33 +0000</pubDate>
      <link>https://dev.to/vinodsys/auto-increment-on-a-mysql-secondary-column-2jcn</link>
      <guid>https://dev.to/vinodsys/auto-increment-on-a-mysql-secondary-column-2jcn</guid>
      <description>&lt;h2&gt;
  
  
  MySQL AUTO_INCREMENT
&lt;/h2&gt;

&lt;p&gt;MySQL provides us with AUTO_INCREMENT attribute that allows us to create a column that contains a sequence of numbers (1, 2, 3, and so on).  AUTO_INCREMENT attribute is generally used to generate a  unique number that act as a primary key in a table.&lt;/p&gt;

&lt;p&gt;Let see a simple example.  Here we have a table Mydevices that stores different devices we have such as laptop, computer, cellphone, tablet and so on.&lt;/p&gt;

&lt;p&gt;The MySQL statement to create the table Device is given below&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE&lt;/code&gt;MyDevices&lt;code&gt;(&lt;br&gt;
&lt;/code&gt;DeviceId&lt;code&gt;int PRIMARY KEY NOT NULL AUTO_INCREMENT,&lt;br&gt;
&lt;/code&gt;DeviceName&lt;code&gt;varchar(10) NOT NULL,&lt;br&gt;
&lt;/code&gt;CreatedAt&lt;code&gt;datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,&lt;br&gt;
&lt;/code&gt;UpdatedAt&lt;code&gt;datetime NOT NULL DEFAULT CURRENT_TIMESTAMP&lt;br&gt;
  );&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Executing this gives us the table MyDevices&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KzA8LQtC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdh1qxcap3qc6sjdfw3p.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KzA8LQtC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdh1qxcap3qc6sjdfw3p.JPG" alt="The table MyDevices" width="880" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets Add a few rows, to see that the sequencing is working as we want.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Insert into mydevices(DeviceName) VALUES ('Laptop');&lt;br&gt;
Insert into mydevices(DeviceName) VALUES ('Computer');&lt;br&gt;
Insert into mydevices(DeviceName) VALUES ('Phone');&lt;br&gt;
Insert into mydevices(DeviceName) VALUES ('Tablet');&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
If we do a query on our table we should find that MySQL have added a nice Sequences number to our DeviceId column&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lbtltqy7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3sn685pbbe9roxr62np.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lbtltqy7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3sn685pbbe9roxr62np.JPG" alt="The Sequence number generated for the Data inserted in the MyDevices table" width="880" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now comes the twist.  Lets add one more column, say CustomerId in the above table.  Lets drop the Devices table and recreate it as follows;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
DROP TABLE MyDevices;&lt;br&gt;
CREATE TABLE&lt;/code&gt;MyDevices&lt;code&gt;(&lt;br&gt;
&lt;/code&gt;CustomerId&lt;code&gt;int NOT NULL,   &lt;br&gt;
&lt;/code&gt;DeviceId&lt;code&gt;int NOT NULL PRIMARY KEY AUTO_INCREMENT,&lt;br&gt;
&lt;/code&gt;DeviceName&lt;code&gt;varchar(10) NOT NULL,&lt;br&gt;
&lt;/code&gt;CreatedAt&lt;code&gt;datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,&lt;br&gt;
&lt;/code&gt;UpdatedAt&lt;code&gt;datetime NOT NULL DEFAULT CURRENT_TIMESTAMP&lt;br&gt;
  );&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Lets Add a few rows, to see that the sequences are working as we want.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Insert into mydevices(CustomerId, DeviceName) VALUES (1,'Laptop');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (1,'Computer');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (1,'Phone');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (2,'Tablet');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (2,'Laptop');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (2,'Printer');&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Lets see how the data looks like now;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S6isqLvM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wnii04yzhqbyk4yjk7kq.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S6isqLvM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wnii04yzhqbyk4yjk7kq.JPG" alt="The same Sequence number for all customers" width="766" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you will see, the auto increment feature keeps on adding the sequences number for each row as we insert.  (1,2,3,4,5,6)&lt;/p&gt;

&lt;p&gt;But what if this is not the behavior we want.. What if we want the sequence number to increase per customer.  That is each customer has its own sequence numbers for the devices.&lt;/p&gt;

&lt;p&gt;So Customer 1, has sequences 1,2,3... and so on&lt;br&gt;
while Customer 2 devices gets a sequence number again from 1,2,3.. and so forth.&lt;/p&gt;

&lt;p&gt;There are many ways to do this such as using stored procedures.  But let us see today a very easy method to achieve this, by defining the table in a certain way.&lt;/p&gt;

&lt;h2&gt;
  
  
  ENGINE= MyISAM
&lt;/h2&gt;

&lt;p&gt;The default engine storage for MySQL relational database management system  prior to versions prior to 5.5 was MyISAM. It is based on the older ISAM code, but it has many useful extensions.&lt;/p&gt;

&lt;p&gt;If we define tables either as MyISAM or BDB, it gives the ability to specify AUTO_INCREMENT on a secondary column in a multiple-column index. &lt;/p&gt;

&lt;p&gt;For such tables, the generated value for the AUTO_INCREMENT column is calculated as MAX(auto_increment_column) + 1 WHERE prefix=given-prefix. &lt;/p&gt;

&lt;p&gt;This is useful when you want to put data into ordered groups.  Lets adapt this to the above example of MyDevices table.&lt;/p&gt;

&lt;p&gt;Lets create the table now as a MyISAM table&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE&lt;/code&gt;MyDevices&lt;code&gt;(&lt;br&gt;
&lt;/code&gt;CustomerId&lt;code&gt;int NOT NULL,&lt;br&gt;
&lt;/code&gt;DeviceId&lt;code&gt;int NOT NULL AUTO_INCREMENT,&lt;br&gt;
&lt;/code&gt;DeviceName&lt;code&gt;varchar(10) NOT NULL,&lt;br&gt;
&lt;/code&gt;CreatedAt&lt;code&gt;datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,&lt;br&gt;
&lt;/code&gt;UpdatedAt&lt;code&gt;datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,&lt;br&gt;
   PRIMARY KEY (&lt;/code&gt;CustomerId&lt;code&gt;,&lt;/code&gt;DeviceId&lt;code&gt;)&lt;br&gt;
  ) ENGINE= MyISAM;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Lets now insert data to this table (we will add a few more inserts that before);&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Insert into mydevices(CustomerId, DeviceName) VALUES (1,'Laptop');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (1,'Computer');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (1,'Phone');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (2,'Tablet');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (2,'Laptop');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (3,'Printer');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (4,'Printer');&lt;br&gt;
Insert into mydevices(CustomerId, DeviceName) VALUES (4,'Laptop');&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Lets see what we got into our tables;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h9oKuCYH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezca4ir3rboh5o76blx5.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h9oKuCYH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezca4ir3rboh5o76blx5.JPG" alt="The table with separate Sequences for each customer" width="781" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There you go, we got now separate sequences for each of the customers. &lt;/p&gt;

&lt;p&gt;QUIZ : In the above table what sequence do you think will customer 3 have for DeviceId if we inserted this SQL statemwent;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Insert into mydevices(CustomerId, DeviceName) VALUES (3,'Fax');&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Answer : 2  ( as the last sequence generated for customer 3 was '1', the next number it assigned will be 1+1 = 2&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article..&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>autoincrement</category>
      <category>tables</category>
      <category>myisam</category>
    </item>
  </channel>
</rss>
